]> begriffs open source - ai-pg/blob - full-docs/txt/sql-alterforeigndatawrapper.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-alterforeigndatawrapper.txt
1
2 ALTER FOREIGN DATA WRAPPER
3
4    ALTER FOREIGN DATA WRAPPER — change the definition of a foreign-data
5    wrapper
6
7 Synopsis
8
9 ALTER FOREIGN DATA WRAPPER name
10     [ HANDLER handler_function | NO HANDLER ]
11     [ VALIDATOR validator_function | NO VALIDATOR ]
12     [ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ]) ]
13 ALTER FOREIGN DATA WRAPPER name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_US
14 ER | SESSION_USER }
15 ALTER FOREIGN DATA WRAPPER name RENAME TO new_name
16
17 Description
18
19    ALTER FOREIGN DATA WRAPPER changes the definition of a foreign-data
20    wrapper. The first form of the command changes the support functions or
21    the generic options of the foreign-data wrapper (at least one clause is
22    required). The second form changes the owner of the foreign-data
23    wrapper.
24
25    Only superusers can alter foreign-data wrappers. Additionally, only
26    superusers can own foreign-data wrappers.
27
28 Parameters
29
30    name
31           The name of an existing foreign-data wrapper.
32
33    HANDLER handler_function
34           Specifies a new handler function for the foreign-data wrapper.
35
36    NO HANDLER
37           This is used to specify that the foreign-data wrapper should no
38           longer have a handler function.
39
40           Note that foreign tables that use a foreign-data wrapper with no
41           handler cannot be accessed.
42
43    VALIDATOR validator_function
44           Specifies a new validator function for the foreign-data wrapper.
45
46           Note that it is possible that pre-existing options of the
47           foreign-data wrapper, or of dependent servers, user mappings, or
48           foreign tables, are invalid according to the new validator.
49           PostgreSQL does not check for this. It is up to the user to make
50           sure that these options are correct before using the modified
51           foreign-data wrapper. However, any options specified in this
52           ALTER FOREIGN DATA WRAPPER command will be checked using the new
53           validator.
54
55    NO VALIDATOR
56           This is used to specify that the foreign-data wrapper should no
57           longer have a validator function.
58
59    OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )
60           Change options for the foreign-data wrapper. ADD, SET, and DROP
61           specify the action to be performed. ADD is assumed if no
62           operation is explicitly specified. Option names must be unique;
63           names and values are also validated using the foreign data
64           wrapper's validator function, if any.
65
66    new_owner
67           The user name of the new owner of the foreign-data wrapper.
68
69    new_name
70           The new name for the foreign-data wrapper.
71
72 Examples
73
74    Change a foreign-data wrapper dbi, add option foo, drop bar:
75 ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo '1', DROP bar);
76
77    Change the foreign-data wrapper dbi validator to bob.myvalidator:
78 ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob.myvalidator;
79
80 Compatibility
81
82    ALTER FOREIGN DATA WRAPPER conforms to ISO/IEC 9075-9 (SQL/MED), except
83    that the HANDLER, VALIDATOR, OWNER TO, and RENAME clauses are
84    extensions.
85
86 See Also
87
88    CREATE FOREIGN DATA WRAPPER, DROP FOREIGN DATA WRAPPER