]> begriffs open source - ai-pg/blob - full-docs/txt/sql-alterextension.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-alterextension.txt
1
2 ALTER EXTENSION
3
4    ALTER EXTENSION — change the definition of an extension
5
6 Synopsis
7
8 ALTER EXTENSION name UPDATE [ TO new_version ]
9 ALTER EXTENSION name SET SCHEMA new_schema
10 ALTER EXTENSION name ADD member_object
11 ALTER EXTENSION name DROP member_object
12
13 where member_object is:
14
15   ACCESS METHOD object_name |
16   AGGREGATE aggregate_name ( aggregate_signature ) |
17   CAST (source_type AS target_type) |
18   COLLATION object_name |
19   CONVERSION object_name |
20   DOMAIN object_name |
21   EVENT TRIGGER object_name |
22   FOREIGN DATA WRAPPER object_name |
23   FOREIGN TABLE object_name |
24   FUNCTION function_name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] |
25   MATERIALIZED VIEW object_name |
26   OPERATOR operator_name (left_type, right_type) |
27   OPERATOR CLASS object_name USING index_method |
28   OPERATOR FAMILY object_name USING index_method |
29   [ PROCEDURAL ] LANGUAGE object_name |
30   PROCEDURE procedure_name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] |
31   ROUTINE routine_name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] |
32   SCHEMA object_name |
33   SEQUENCE object_name |
34   SERVER object_name |
35   TABLE object_name |
36   TEXT SEARCH CONFIGURATION object_name |
37   TEXT SEARCH DICTIONARY object_name |
38   TEXT SEARCH PARSER object_name |
39   TEXT SEARCH TEMPLATE object_name |
40   TRANSFORM FOR type_name LANGUAGE lang_name |
41   TYPE object_name |
42   VIEW object_name
43
44 and aggregate_signature is:
45
46 * |
47 [ argmode ] [ argname ] argtype [ , ... ] |
48 [ [ argmode ] [ argname ] argtype [ , ... ] ] ORDER BY [ argmode ] [ argname ] a
49 rgtype [ , ... ]
50
51 Description
52
53    ALTER EXTENSION changes the definition of an installed extension. There
54    are several subforms:
55
56    UPDATE
57           This form updates the extension to a newer version. The
58           extension must supply a suitable update script (or series of
59           scripts) that can modify the currently-installed version into
60           the requested version.
61
62    SET SCHEMA
63           This form moves the extension's objects into another schema. The
64           extension has to be relocatable for this command to succeed.
65
66    ADD member_object
67           This form adds an existing object to the extension. This is
68           mainly useful in extension update scripts. The object will
69           subsequently be treated as a member of the extension; notably,
70           it can only be dropped by dropping the extension.
71
72    DROP member_object
73           This form removes a member object from the extension. This is
74           mainly useful in extension update scripts. The object is not
75           dropped, only disassociated from the extension.
76
77    See Section 36.17 for more information about these operations.
78
79    You must own the extension to use ALTER EXTENSION. The ADD/DROP forms
80    require ownership of the added/dropped object as well.
81
82 Parameters
83
84    name
85           The name of an installed extension.
86
87    new_version
88           The desired new version of the extension. This can be written as
89           either an identifier or a string literal. If not specified,
90           ALTER EXTENSION UPDATE attempts to update to whatever is shown
91           as the default version in the extension's control file.
92
93    new_schema
94           The new schema for the extension.
95
96    object_name
97           aggregate_name
98           function_name
99           operator_name
100           procedure_name
101           routine_name
102           The name of an object to be added to or removed from the
103           extension. Names of tables, aggregates, domains, foreign tables,
104           functions, operators, operator classes, operator families,
105           procedures, routines, sequences, text search objects, types, and
106           views can be schema-qualified.
107
108    source_type
109           The name of the source data type of the cast.
110
111    target_type
112           The name of the target data type of the cast.
113
114    argmode
115           The mode of a function, procedure, or aggregate argument: IN,
116           OUT, INOUT, or VARIADIC. If omitted, the default is IN. Note
117           that ALTER EXTENSION does not actually pay any attention to OUT
118           arguments, since only the input arguments are needed to
119           determine the function's identity. So it is sufficient to list
120           the IN, INOUT, and VARIADIC arguments.
121
122    argname
123           The name of a function, procedure, or aggregate argument. Note
124           that ALTER EXTENSION does not actually pay any attention to
125           argument names, since only the argument data types are needed to
126           determine the function's identity.
127
128    argtype
129           The data type of a function, procedure, or aggregate argument.
130
131    left_type
132           right_type
133           The data type(s) of the operator's arguments (optionally
134           schema-qualified). Write NONE for the missing argument of a
135           prefix operator.
136
137    PROCEDURAL
138           This is a noise word.
139
140    type_name
141           The name of the data type of the transform.
142
143    lang_name
144           The name of the language of the transform.
145
146 Examples
147
148    To update the hstore extension to version 2.0:
149 ALTER EXTENSION hstore UPDATE TO '2.0';
150
151    To change the schema of the hstore extension to utils:
152 ALTER EXTENSION hstore SET SCHEMA utils;
153
154    To add an existing function to the hstore extension:
155 ALTER EXTENSION hstore ADD FUNCTION populate_record(anyelement, hstore);
156
157 Compatibility
158
159    ALTER EXTENSION is a PostgreSQL extension.
160
161 See Also
162
163    CREATE EXTENSION, DROP EXTENSION