@@ -23,16 +23,41 @@ PostgreSQL documentation
23
23
24
24
<refsynopsisdiv>
25
25
<synopsis>
26
- ALTER EXTENSION <replaceable class="PARAMETER">name</replaceable> SET SCHEMA <replaceable class="PARAMETER">new_schema</replaceable>
26
+ ALTER EXTENSION <replaceable class="PARAMETER">extension_name</replaceable> SET SCHEMA <replaceable class="PARAMETER">new_schema</replaceable>
27
+ ALTER EXTENSION <replaceable class="PARAMETER">extension_name</replaceable> ADD <replaceable class="PARAMETER">member_object</replaceable>
28
+
29
+ <phrase>where <replaceable class="PARAMETER">member_object</replaceable> is:</phrase>
30
+
31
+ AGGREGATE <replaceable class="PARAMETER">agg_name</replaceable> (<replaceable class="PARAMETER">agg_type</replaceable> [, ...] ) |
32
+ CAST (<replaceable>source_type</replaceable> AS <replaceable>target_type</replaceable>) |
33
+ CONVERSION <replaceable class="PARAMETER">object_name</replaceable> |
34
+ DOMAIN <replaceable class="PARAMETER">object_name</replaceable> |
35
+ FOREIGN DATA WRAPPER <replaceable class="PARAMETER">object_name</replaceable> |
36
+ FOREIGN TABLE <replaceable class="PARAMETER">object_name</replaceable> |
37
+ FUNCTION <replaceable class="PARAMETER">function_name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) |
38
+ OPERATOR <replaceable class="PARAMETER">operator_name</replaceable> (<replaceable class="PARAMETER">left_type</replaceable>, <replaceable class="PARAMETER">right_type</replaceable>) |
39
+ OPERATOR CLASS <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> |
40
+ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> |
41
+ [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> |
42
+ SCHEMA <replaceable class="PARAMETER">object_name</replaceable> |
43
+ SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> |
44
+ SERVER <replaceable class="PARAMETER">object_name</replaceable> |
45
+ TABLE <replaceable class="PARAMETER">object_name</replaceable> |
46
+ TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> |
47
+ TEXT SEARCH DICTIONARY <replaceable class="PARAMETER">object_name</replaceable> |
48
+ TEXT SEARCH PARSER <replaceable class="PARAMETER">object_name</replaceable> |
49
+ TEXT SEARCH TEMPLATE <replaceable class="PARAMETER">object_name</replaceable> |
50
+ TYPE <replaceable class="PARAMETER">object_name</replaceable> |
51
+ VIEW <replaceable class="PARAMETER">object_name</replaceable>
27
52
</synopsis>
28
53
</refsynopsisdiv>
29
54
30
55
<refsect1>
31
56
<title>Description</title>
32
57
33
58
<para>
34
- <command>ALTER EXTENSION</command> changes the definition of an existing extension.
35
- Currently there is only one subform :
59
+ <command>ALTER EXTENSION</command> changes the definition of an installed
60
+ extension. There are several subforms :
36
61
37
62
<variablelist>
38
63
<varlistentry>
@@ -41,37 +66,151 @@ ALTER EXTENSION <replaceable class="PARAMETER">name</replaceable> SET SCHEMA <re
41
66
<para>
42
67
This form moves the extension's objects into another schema. The
43
68
extension has to be <firstterm>relocatable</> for this command to
44
- succeed. See <xref linkend="extend-extensions"> for details.
69
+ succeed.
70
+ </para>
71
+ </listitem>
72
+ </varlistentry>
73
+
74
+ <varlistentry>
75
+ <term><literal>ADD <replaceable class="PARAMETER">member_object</replaceable></literal></term>
76
+ <listitem>
77
+ <para>
78
+ This form adds an existing object to the extension. This is mainly
79
+ useful in extension upgrade scripts. The object will subsequently
80
+ be treated as a member of the extension; notably, it can only be
81
+ dropped by dropping the extension.
45
82
</para>
46
83
</listitem>
47
84
</varlistentry>
48
85
</variablelist>
86
+
87
+ See <xref linkend="extend-extensions"> for more information about these
88
+ operations.
89
+ </para>
90
+
91
+ <para>
92
+ Only superusers can execute <command>ALTER EXTENSION</command>.
49
93
</para>
50
94
</refsect1>
51
95
52
96
<refsect1>
53
97
<title>Parameters</title>
54
98
55
- <para>
56
- <variablelist>
57
- <varlistentry>
58
- <term><replaceable class="PARAMETER">name</replaceable></term>
59
- <listitem>
60
- <para>
61
- The name of an installed extension.
62
- </para>
63
- </listitem>
64
- </varlistentry>
65
-
66
- <varlistentry>
67
- <term><replaceable class="PARAMETER">new_schema</replaceable></term>
68
- <listitem>
69
- <para>
70
- The new schema for the extension.
71
- </para>
72
- </listitem>
73
- </varlistentry>
74
- </variablelist>
99
+ <para>
100
+ <variablelist>
101
+ <varlistentry>
102
+ <term><replaceable class="PARAMETER">extension_name</replaceable></term>
103
+ <listitem>
104
+ <para>
105
+ The name of an installed extension.
106
+ </para>
107
+ </listitem>
108
+ </varlistentry>
109
+
110
+ <varlistentry>
111
+ <term><replaceable class="PARAMETER">new_schema</replaceable></term>
112
+ <listitem>
113
+ <para>
114
+ The new schema for the extension.
115
+ </para>
116
+ </listitem>
117
+ </varlistentry>
118
+
119
+ <varlistentry>
120
+ <term><replaceable class="parameter">object_name</replaceable></term>
121
+ <term><replaceable class="parameter">agg_name</replaceable></term>
122
+ <term><replaceable class="parameter">function_name</replaceable></term>
123
+ <term><replaceable class="parameter">operator_name</replaceable></term>
124
+ <listitem>
125
+ <para>
126
+ The name of an object to be added to the extension. Names of tables,
127
+ aggregates, domains, foreign tables, functions, operators,
128
+ operator classes, operator families, sequences, text search objects,
129
+ types, and views can be schema-qualified.
130
+ </para>
131
+ </listitem>
132
+ </varlistentry>
133
+
134
+ <varlistentry>
135
+ <term><replaceable class="parameter">agg_type</replaceable></term>
136
+ <listitem>
137
+ <para>
138
+ An input data type on which the aggregate function operates.
139
+ To reference a zero-argument aggregate function, write <literal>*</>
140
+ in place of the list of input data types.
141
+ </para>
142
+ </listitem>
143
+ </varlistentry>
144
+
145
+ <varlistentry>
146
+ <term><replaceable>source_type</replaceable></term>
147
+ <listitem>
148
+ <para>
149
+ The name of the source data type of the cast.
150
+ </para>
151
+ </listitem>
152
+ </varlistentry>
153
+
154
+ <varlistentry>
155
+ <term><replaceable>target_type</replaceable></term>
156
+ <listitem>
157
+ <para>
158
+ The name of the target data type of the cast.
159
+ </para>
160
+ </listitem>
161
+ </varlistentry>
162
+
163
+ <varlistentry>
164
+ <term><replaceable class="parameter">argmode</replaceable></term>
165
+
166
+ <listitem>
167
+ <para>
168
+ The mode of a function argument: <literal>IN</>, <literal>OUT</>,
169
+ <literal>INOUT</>, or <literal>VARIADIC</>.
170
+ If omitted, the default is <literal>IN</>.
171
+ Note that <command>ALTER EXTENSION</command> does not actually pay
172
+ any attention to <literal>OUT</> arguments, since only the input
173
+ arguments are needed to determine the function's identity.
174
+ So it is sufficient to list the <literal>IN</>, <literal>INOUT</>,
175
+ and <literal>VARIADIC</> arguments.
176
+ </para>
177
+ </listitem>
178
+ </varlistentry>
179
+
180
+ <varlistentry>
181
+ <term><replaceable class="parameter">argname</replaceable></term>
182
+
183
+ <listitem>
184
+ <para>
185
+ The name of a function argument.
186
+ Note that <command>ALTER EXTENSION</command> does not actually pay
187
+ any attention to argument names, since only the argument data
188
+ types are needed to determine the function's identity.
189
+ </para>
190
+ </listitem>
191
+ </varlistentry>
192
+
193
+ <varlistentry>
194
+ <term><replaceable class="parameter">argtype</replaceable></term>
195
+
196
+ <listitem>
197
+ <para>
198
+ The data type(s) of the function's arguments (optionally
199
+ schema-qualified), if any.
200
+ </para>
201
+ </listitem>
202
+ </varlistentry>
203
+
204
+ <varlistentry>
205
+ <term><literal>PROCEDURAL</literal></term>
206
+
207
+ <listitem>
208
+ <para>
209
+ This is a noise word.
210
+ </para>
211
+ </listitem>
212
+ </varlistentry>
213
+ </variablelist>
75
214
</para>
76
215
</refsect1>
77
216
@@ -83,6 +222,13 @@ ALTER EXTENSION <replaceable class="PARAMETER">name</replaceable> SET SCHEMA <re
83
222
to <literal>utils</literal>:
84
223
<programlisting>
85
224
ALTER EXTENSION hstore SET SCHEMA utils;
225
+ </programlisting>
226
+ </para>
227
+
228
+ <para>
229
+ To add an existing function to the <literal>hstore</literal> extension:
230
+ <programlisting>
231
+ ALTER EXTENSION hstore ADD FUNCTION populate_record(anyelement, hstore);
86
232
</programlisting>
87
233
</para>
88
234
</refsect1>
0 commit comments