1ALTER STATISTICS(7)      PostgreSQL 16.1 Documentation     ALTER STATISTICS(7)
2
3
4

NAME

6       ALTER_STATISTICS - change the definition of an extended statistics
7       object
8

SYNOPSIS

10       ALTER STATISTICS name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
11       ALTER STATISTICS name RENAME TO new_name
12       ALTER STATISTICS name SET SCHEMA new_schema
13       ALTER STATISTICS name SET STATISTICS new_target
14

DESCRIPTION

16       ALTER STATISTICS changes the parameters of an existing extended
17       statistics object. Any parameters not specifically set in the ALTER
18       STATISTICS command retain their prior settings.
19
20       You must own the statistics object to use ALTER STATISTICS. To change a
21       statistics object's schema, you must also have CREATE privilege on the
22       new schema. To alter the owner, you must be able to SET ROLE to the new
23       owning role, and that role must have CREATE privilege on the statistics
24       object's schema. (These restrictions enforce that altering the owner
25       doesn't do anything you couldn't do by dropping and recreating the
26       statistics object. However, a superuser can alter ownership of any
27       statistics object anyway.)
28

PARAMETERS

30       name
31           The name (optionally schema-qualified) of the statistics object to
32           be altered.
33
34       new_owner
35           The user name of the new owner of the statistics object.
36
37       new_name
38           The new name for the statistics object.
39
40       new_schema
41           The new schema for the statistics object.
42
43       new_target
44           The statistic-gathering target for this statistics object for
45           subsequent ANALYZE operations. The target can be set in the range 0
46           to 10000; alternatively, set it to -1 to revert to using the
47           maximum of the statistics target of the referenced columns, if set,
48           or the system default statistics target
49           (default_statistics_target). For more information on the use of
50           statistics by the PostgreSQL query planner, refer to Section 14.2.
51

COMPATIBILITY

53       There is no ALTER STATISTICS command in the SQL standard.
54

SEE ALSO

56       CREATE STATISTICS (CREATE_STATISTICS(7)), DROP STATISTICS
57       (DROP_STATISTICS(7))
58
59
60
61PostgreSQL 16.1                      2023                  ALTER STATISTICS(7)
Impressum