1ALTER EXTENSION(7)       PostgreSQL 10.7 Documentation      ALTER EXTENSION(7)
2
3
4

NAME

6       ALTER_EXTENSION - change the definition of an extension
7

SYNOPSIS

9       ALTER EXTENSION name UPDATE [ TO new_version ]
10       ALTER EXTENSION name SET SCHEMA new_schema
11       ALTER EXTENSION name ADD member_object
12       ALTER EXTENSION name DROP member_object
13
14       where member_object is:
15
16         ACCESS METHOD object_name |
17         AGGREGATE aggregate_name ( aggregate_signature ) |
18         CAST (source_type AS target_type) |
19         COLLATION object_name |
20         CONVERSION object_name |
21         DOMAIN object_name |
22         EVENT TRIGGER object_name |
23         FOREIGN DATA WRAPPER object_name |
24         FOREIGN TABLE object_name |
25         FUNCTION function_name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] |
26         MATERIALIZED VIEW object_name |
27         OPERATOR operator_name (left_type, right_type) |
28         OPERATOR CLASS object_name USING index_method |
29         OPERATOR FAMILY object_name USING index_method |
30         [ PROCEDURAL ] LANGUAGE object_name |
31         SCHEMA object_name |
32         SEQUENCE object_name |
33         SERVER object_name |
34         TABLE object_name |
35         TEXT SEARCH CONFIGURATION object_name |
36         TEXT SEARCH DICTIONARY object_name |
37         TEXT SEARCH PARSER object_name |
38         TEXT SEARCH TEMPLATE object_name |
39         TRANSFORM FOR type_name LANGUAGE lang_name |
40         TYPE object_name |
41         VIEW object_name
42
43       and aggregate_signature is:
44
45       * |
46       [ argmode ] [ argname ] argtype [ , ... ] |
47       [ [ argmode ] [ argname ] argtype [ , ... ] ] ORDER BY [ argmode ] [ argname ] argtype [ , ... ]
48

DESCRIPTION

50       ALTER EXTENSION changes the definition of an installed extension. There
51       are several subforms:
52
53       UPDATE
54           This form updates the extension to a newer version. The extension
55           must supply a suitable update script (or series of scripts) that
56           can modify the currently-installed version into the requested
57           version.
58
59       SET SCHEMA
60           This form moves the extension's objects into another schema. The
61           extension has to be relocatable for this command to succeed.
62
63       ADD member_object
64           This form adds an existing object to the extension. This is mainly
65           useful in extension update scripts. The object will subsequently be
66           treated as a member of the extension; notably, it can only be
67           dropped by dropping the extension.
68
69       DROP member_object
70           This form removes a member object from the extension. This is
71           mainly useful in extension update scripts. The object is not
72           dropped, only disassociated from the extension.
73       See Section 37.15 for more information about these operations.
74
75       You must own the extension to use ALTER EXTENSION. The ADD/DROP forms
76       require ownership of the added/dropped object as well.
77

PARAMETERS

79       name
80           The name of an installed extension.
81
82       new_version
83           The desired new version of the extension. This can be written as
84           either an identifier or a string literal. If not specified, ALTER
85           EXTENSION UPDATE attempts to update to whatever is shown as the
86           default version in the extension's control file.
87
88       new_schema
89           The new schema for the extension.
90
91       object_name
92       aggregate_name
93       function_name
94       operator_name
95           The name of an object to be added to or removed from the extension.
96           Names of tables, aggregates, domains, foreign tables, functions,
97           operators, operator classes, operator families, sequences, text
98           search objects, types, and views can be schema-qualified.
99
100       source_type
101           The name of the source data type of the cast.
102
103       target_type
104           The name of the target data type of the cast.
105
106       argmode
107           The mode of a function or aggregate argument: IN, OUT, INOUT, or
108           VARIADIC. If omitted, the default is IN. Note that ALTER EXTENSION
109           does not actually pay any attention to OUT arguments, since only
110           the input arguments are needed to determine the function's
111           identity. So it is sufficient to list the IN, INOUT, and VARIADIC
112           arguments.
113
114       argname
115           The name of a function or aggregate argument. Note that ALTER
116           EXTENSION does not actually pay any attention to argument names,
117           since only the argument data types are needed to determine the
118           function's identity.
119
120       argtype
121           The data type of a function or aggregate argument.
122
123       left_type
124       right_type
125           The data type(s) of the operator's arguments (optionally
126           schema-qualified). Write NONE for the missing argument of a prefix
127           or postfix operator.
128
129       PROCEDURAL
130           This is a noise word.
131
132       type_name
133           The name of the data type of the transform.
134
135       lang_name
136           The name of the language of the transform.
137

EXAMPLES

139       To update the hstore extension to version 2.0:
140
141           ALTER EXTENSION hstore UPDATE TO '2.0';
142
143       To change the schema of the hstore extension to utils:
144
145           ALTER EXTENSION hstore SET SCHEMA utils;
146
147       To add an existing function to the hstore extension:
148
149           ALTER EXTENSION hstore ADD FUNCTION populate_record(anyelement, hstore);
150

COMPATIBILITY

152       ALTER EXTENSION is a PostgreSQL extension.
153

SEE ALSO

155       CREATE EXTENSION (CREATE_EXTENSION(7)), DROP EXTENSION
156       (DROP_EXTENSION(7))
157
158
159
160PostgreSQL 10.7                      2019                   ALTER EXTENSION(7)
Impressum