1ALTER EXTENSION(7) PostgreSQL 9.2.24 Documentation ALTER EXTENSION(7)
2
3
4
6 ALTER_EXTENSION - change the definition of an extension
7
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 AGGREGATE agg_name (agg_type [, ...] ) |
17 CAST (source_type AS target_type) |
18 COLLATION object_name |
19 CONVERSION object_name |
20 DOMAIN object_name |
21 FOREIGN DATA WRAPPER object_name |
22 FOREIGN TABLE object_name |
23 FUNCTION function_name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) |
24 OPERATOR operator_name (left_type, right_type) |
25 OPERATOR CLASS object_name USING index_method |
26 OPERATOR FAMILY object_name USING index_method |
27 [ PROCEDURAL ] LANGUAGE object_name |
28 SCHEMA object_name |
29 SEQUENCE object_name |
30 SERVER object_name |
31 TABLE object_name |
32 TEXT SEARCH CONFIGURATION object_name |
33 TEXT SEARCH DICTIONARY object_name |
34 TEXT SEARCH PARSER object_name |
35 TEXT SEARCH TEMPLATE object_name |
36 TYPE object_name |
37 VIEW object_name
38
40 ALTER EXTENSION changes the definition of an installed extension. There
41 are several subforms:
42
43 UPDATE
44 This form updates the extension to a newer version. The extension
45 must supply a suitable update script (or series of scripts) that
46 can modify the currently-installed version into the requested
47 version.
48
49 SET SCHEMA
50 This form moves the extension's objects into another schema. The
51 extension has to be relocatable for this command to succeed.
52
53 ADD member_object
54 This form adds an existing object to the extension. This is mainly
55 useful in extension update scripts. The object will subsequently be
56 treated as a member of the extension; notably, it can only be
57 dropped by dropping the extension.
58
59 DROP member_object
60 This form removes a member object from the extension. This is
61 mainly useful in extension update scripts. The object is not
62 dropped, only disassociated from the extension.
63 See Section 35.15, “Packaging Related Objects into an Extension”, in
64 the documentation for more information about these operations.
65
66 You must own the extension to use ALTER EXTENSION. The ADD/DROP forms
67 require ownership of the added/dropped object as well.
68
70 name
71 The name of an installed extension.
72
73 new_version
74 The desired new version of the extension. This can be written as
75 either an identifier or a string literal. If not specified, ALTER
76 EXTENSION UPDATE attempts to update to whatever is shown as the
77 default version in the extension's control file.
78
79 new_schema
80 The new schema for the extension.
81
82 object_name, agg_name, function_name, operator_name
83 The name of an object to be added to or removed from the extension.
84 Names of tables, aggregates, domains, foreign tables, functions,
85 operators, operator classes, operator families, sequences, text
86 search objects, types, and views can be schema-qualified.
87
88 agg_type
89 An input data type on which the aggregate function operates. To
90 reference a zero-argument aggregate function, write * in place of
91 the list of input data types.
92
93 source_type
94 The name of the source data type of the cast.
95
96 target_type
97 The name of the target data type of the cast.
98
99 argmode
100 The mode of a function argument: IN, OUT, INOUT, or VARIADIC. If
101 omitted, the default is IN. Note that ALTER EXTENSION does not
102 actually pay any attention to OUT arguments, since only the input
103 arguments are needed to determine the function's identity. So it is
104 sufficient to list the IN, INOUT, and VARIADIC arguments.
105
106 argname
107 The name of a function argument. Note that ALTER EXTENSION does not
108 actually pay any attention to argument names, since only the
109 argument data types are needed to determine the function's
110 identity.
111
112 argtype
113 The data type(s) of the function's arguments (optionally
114 schema-qualified), if any.
115
116 left_type, right_type
117 The data type(s) of the operator's arguments (optionally
118 schema-qualified). Write NONE for the missing argument of a prefix
119 or postfix operator.
120
121 PROCEDURAL
122 This is a noise word.
123
125 To update the hstore extension to version 2.0:
126
127 ALTER EXTENSION hstore UPDATE TO '2.0';
128
129 To change the schema of the hstore extension to utils:
130
131 ALTER EXTENSION hstore SET SCHEMA utils;
132
133 To add an existing function to the hstore extension:
134
135 ALTER EXTENSION hstore ADD FUNCTION populate_record(anyelement, hstore);
136
138 ALTER EXTENSION is a PostgreSQL extension.
139
141 CREATE EXTENSION (CREATE_EXTENSION(7)), DROP EXTENSION
142 (DROP_EXTENSION(7))
143
144
145
146PostgreSQL 9.2.24 2017-11-06 ALTER EXTENSION(7)