]> begriffs open source - ai-pg/blob - full-docs/txt/sql-alterstatistics.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-alterstatistics.txt
1
2 ALTER STATISTICS
3
4    ALTER STATISTICS — change the definition of an extended statistics
5    object
6
7 Synopsis
8
9 ALTER STATISTICS name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSI
10 ON_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 | DEFAULT }
14
15 Description
16
17    ALTER STATISTICS changes the parameters of an existing extended
18    statistics object. Any parameters not specifically set in the ALTER
19    STATISTICS command retain their prior settings.
20
21    You must own the statistics object to use ALTER STATISTICS. To change a
22    statistics object's schema, you must also have CREATE privilege on the
23    new schema. To alter the owner, you must be able to SET ROLE to the new
24    owning role, and that role must have CREATE privilege on the statistics
25    object's schema. (These restrictions enforce that altering the owner
26    doesn't do anything you couldn't do by dropping and recreating the
27    statistics object. However, a superuser can alter ownership of any
28    statistics object anyway.)
29
30 Parameters
31
32    name
33           The name (optionally schema-qualified) of the statistics object
34           to be altered.
35
36    new_owner
37           The user name of the new owner of the statistics object.
38
39    new_name
40           The new name for the statistics object.
41
42    new_schema
43           The new schema for the statistics object.
44
45    new_target
46           The statistic-gathering target for this statistics object for
47           subsequent ANALYZE operations. The target can be set in the
48           range 0 to 10000. Set it to DEFAULT to revert to using the
49           system default statistics target (default_statistics_target).
50           (Setting to a value of -1 is an obsolete way spelling to get the
51           same outcome.) For more information on the use of statistics by
52           the PostgreSQL query planner, refer to Section 14.2.
53
54 Compatibility
55
56    There is no ALTER STATISTICS command in the SQL standard.
57
58 See Also
59
60    CREATE STATISTICS, DROP STATISTICS