]> begriffs open source - ai-pg/blob - full-docs/man7/ALTER_STATISTICS.7
Include links to all subsection html pages, with shorter paths too
[ai-pg] / full-docs / man7 / ALTER_STATISTICS.7
1 '\" t
2 .\"     Title: ALTER STATISTICS
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "ALTER STATISTICS" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 ALTER_STATISTICS \- change the definition of an extended statistics object
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 ALTER STATISTICS \fIname\fR OWNER TO { \fInew_owner\fR | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
36 ALTER STATISTICS \fIname\fR RENAME TO \fInew_name\fR
37 ALTER STATISTICS \fIname\fR SET SCHEMA \fInew_schema\fR
38 ALTER STATISTICS \fIname\fR SET STATISTICS { \fInew_target\fR | DEFAULT }
39 .fi
40 .SH "DESCRIPTION"
41 .PP
42 \fBALTER STATISTICS\fR
43 changes the parameters of an existing extended statistics object\&. Any parameters not specifically set in the
44 \fBALTER STATISTICS\fR
45 command retain their prior settings\&.
46 .PP
47 You must own the statistics object to use
48 \fBALTER STATISTICS\fR\&. To change a statistics object\*(Aqs schema, you must also have
49 CREATE
50 privilege on the new schema\&. To alter the owner, you must be able to
51 SET ROLE
52 to the new owning role, and that role must have
53 CREATE
54 privilege on the statistics object\*(Aqs schema\&. (These restrictions enforce that altering the owner doesn\*(Aqt do anything you couldn\*(Aqt do by dropping and recreating the statistics object\&. However, a superuser can alter ownership of any statistics object anyway\&.)
55 .SH "PARAMETERS"
56 .PP
57 .PP
58 \fIname\fR
59 .RS 4
60 The name (optionally schema\-qualified) of the statistics object to be altered\&.
61 .RE
62 .PP
63 \fInew_owner\fR
64 .RS 4
65 The user name of the new owner of the statistics object\&.
66 .RE
67 .PP
68 \fInew_name\fR
69 .RS 4
70 The new name for the statistics object\&.
71 .RE
72 .PP
73 \fInew_schema\fR
74 .RS 4
75 The new schema for the statistics object\&.
76 .RE
77 .PP
78 \fInew_target\fR
79 .RS 4
80 The statistic\-gathering target for this statistics object for subsequent
81 \fBANALYZE\fR
82 operations\&. The target can be set in the range 0 to 10000\&. Set it to
83 DEFAULT
84 to revert to using the system default statistics target (default_statistics_target)\&. (Setting to a value of \-1 is an obsolete way spelling to get the same outcome\&.) For more information on the use of statistics by the
85 PostgreSQL
86 query planner, refer to
87 Section\ \&14.2\&.
88 .RE
89 .SH "COMPATIBILITY"
90 .PP
91 There is no
92 \fBALTER STATISTICS\fR
93 command in the SQL standard\&.
94 .SH "SEE ALSO"
95 CREATE STATISTICS (\fBCREATE_STATISTICS\fR(7)), DROP STATISTICS (\fBDROP_STATISTICS\fR(7))