2 .\" Title: ALTER FOREIGN DATA WRAPPER
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "ALTER FOREIGN DATA WRAPPER" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 ALTER_FOREIGN_DATA_WRAPPER \- change the definition of a foreign\-data wrapper
35 ALTER FOREIGN DATA WRAPPER \fIname\fR
36 [ HANDLER \fIhandler_function\fR | NO HANDLER ]
37 [ VALIDATOR \fIvalidator_function\fR | NO VALIDATOR ]
38 [ OPTIONS ( [ ADD | SET | DROP ] \fIoption\fR [\*(Aq\fIvalue\fR\*(Aq] [, \&.\&.\&. ]) ]
39 ALTER FOREIGN DATA WRAPPER \fIname\fR OWNER TO { \fInew_owner\fR | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
40 ALTER FOREIGN DATA WRAPPER \fIname\fR RENAME TO \fInew_name\fR
44 \fBALTER FOREIGN DATA WRAPPER\fR
45 changes the definition of a foreign\-data wrapper\&. The first form of the command changes the support functions or the generic options of the foreign\-data wrapper (at least one clause is required)\&. The second form changes the owner of the foreign\-data wrapper\&.
47 Only superusers can alter foreign\-data wrappers\&. Additionally, only superusers can own foreign\-data wrappers\&.
52 The name of an existing foreign\-data wrapper\&.
55 HANDLER \fIhandler_function\fR
57 Specifies a new handler function for the foreign\-data wrapper\&.
62 This is used to specify that the foreign\-data wrapper should no longer have a handler function\&.
64 Note that foreign tables that use a foreign\-data wrapper with no handler cannot be accessed\&.
67 VALIDATOR \fIvalidator_function\fR
69 Specifies a new validator function for the foreign\-data wrapper\&.
71 Note that it is possible that pre\-existing options of the foreign\-data wrapper, or of dependent servers, user mappings, or foreign tables, are invalid according to the new validator\&.
73 does not check for this\&. It is up to the user to make sure that these options are correct before using the modified foreign\-data wrapper\&. However, any options specified in this
74 \fBALTER FOREIGN DATA WRAPPER\fR
75 command will be checked using the new validator\&.
80 This is used to specify that the foreign\-data wrapper should no longer have a validator function\&.
83 OPTIONS ( [ ADD | SET | DROP ] \fIoption\fR [\*(Aq\fIvalue\fR\*(Aq] [, \&.\&.\&. ] )
85 Change options for the foreign\-data wrapper\&.
89 specify the action to be performed\&.
91 is assumed if no operation is explicitly specified\&. Option names must be unique; names and values are also validated using the foreign data wrapper\*(Aqs validator function, if any\&.
96 The user name of the new owner of the foreign\-data wrapper\&.
101 The new name for the foreign\-data wrapper\&.
105 Change a foreign\-data wrapper
114 ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo \*(Aq1\*(Aq, DROP bar);
120 Change the foreign\-data wrapper
129 ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob\&.myvalidator;
136 \fBALTER FOREIGN DATA WRAPPER\fR
137 conforms to ISO/IEC 9075\-9 (SQL/MED), except that the
142 clauses are extensions\&.
144 CREATE FOREIGN DATA WRAPPER (\fBCREATE_FOREIGN_DATA_WRAPPER\fR(7)), DROP FOREIGN DATA WRAPPER (\fBDROP_FOREIGN_DATA_WRAPPER\fR(7))