1<!--
2doc/src/sgml/ref/alter_statistics.sgml
3PostgreSQL documentation
4-->
5
6<refentry id="SQL-ALTERSTATISTICS">
7 <indexterm zone="sql-alterstatistics">
8  <primary>ALTER STATISTICS</primary>
9 </indexterm>
10
11 <refmeta>
12  <refentrytitle>ALTER STATISTICS</refentrytitle>
13  <manvolnum>7</manvolnum>
14  <refmiscinfo>SQL - Language Statements</refmiscinfo>
15 </refmeta>
16
17 <refnamediv>
18  <refname>ALTER STATISTICS</refname>
19  <refpurpose>
20   change the definition of an extended statistics object
21  </refpurpose>
22 </refnamediv>
23
24 <refsynopsisdiv>
25<synopsis>
26ALTER STATISTICS <replaceable class="parameter">name</replaceable> OWNER TO { <replaceable class="PARAMETER">new_owner</replaceable> | CURRENT_USER | SESSION_USER }
27ALTER STATISTICS <replaceable class="parameter">name</replaceable> RENAME TO <replaceable class="parameter">new_name</replaceable>
28ALTER STATISTICS <replaceable class="parameter">name</replaceable> SET SCHEMA <replaceable class="parameter">new_schema</replaceable>
29</synopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33  <title>Description</title>
34
35  <para>
36   <command>ALTER STATISTICS</command> changes the parameters of an existing
37   extended statistics object.  Any parameters not specifically set in the
38   <command>ALTER STATISTICS</command> command retain their prior settings.
39  </para>
40
41  <para>
42   You must own the statistics object to use <command>ALTER STATISTICS</>.
43   To change a statistics object's schema, you must also
44   have <literal>CREATE</> privilege on the new schema.
45   To alter the owner, you must also be a direct or indirect member of the new
46   owning role, and that role must have <literal>CREATE</literal> privilege on
47   the statistics object's schema.  (These restrictions enforce that altering
48   the owner doesn't do anything you couldn't do by dropping and recreating
49   the statistics object.  However, a superuser can alter ownership of any
50   statistics object anyway.)
51  </para>
52 </refsect1>
53
54 <refsect1>
55  <title>Parameters</title>
56
57   <para>
58    <variablelist>
59     <varlistentry>
60      <term><replaceable class="parameter">name</replaceable></term>
61      <listitem>
62       <para>
63        The name (optionally schema-qualified) of the statistics object to be
64        altered.
65       </para>
66      </listitem>
67     </varlistentry>
68
69     <varlistentry>
70      <term><replaceable class="PARAMETER">new_owner</replaceable></term>
71      <listitem>
72       <para>
73        The user name of the new owner of the statistics object.
74       </para>
75      </listitem>
76     </varlistentry>
77
78     <varlistentry>
79      <term><replaceable class="parameter">new_name</replaceable></term>
80      <listitem>
81       <para>
82        The new name for the statistics object.
83       </para>
84      </listitem>
85     </varlistentry>
86
87     <varlistentry>
88      <term><replaceable class="parameter">new_schema</replaceable></term>
89      <listitem>
90       <para>
91        The new schema for the statistics object.
92       </para>
93      </listitem>
94     </varlistentry>
95
96    </variablelist>
97   </para>
98  </refsect1>
99
100 <refsect1>
101  <title>Compatibility</title>
102
103  <para>
104   There is no <command>ALTER STATISTICS</command> command in the SQL standard.
105  </para>
106 </refsect1>
107
108 <refsect1>
109  <title>See Also</title>
110
111  <simplelist type="inline">
112   <member><xref linkend="sql-createstatistics"></member>
113   <member><xref linkend="sql-dropstatistics"></member>
114  </simplelist>
115 </refsect1>
116
117</refentry>
118