]> begriffs open source - ai-pg/blob - full-docs/man7/ALTER_FOREIGN_DATA_WRAPPER.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / ALTER_FOREIGN_DATA_WRAPPER.7
1 '\" t
2 .\"     Title: ALTER FOREIGN DATA WRAPPER
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 ALTER_FOREIGN_DATA_WRAPPER \- change the definition of a foreign\-data wrapper
32 .SH "SYNOPSIS"
33 .sp
34 .nf
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
41 .fi
42 .SH "DESCRIPTION"
43 .PP
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\&.
46 .PP
47 Only superusers can alter foreign\-data wrappers\&. Additionally, only superusers can own foreign\-data wrappers\&.
48 .SH "PARAMETERS"
49 .PP
50 \fIname\fR
51 .RS 4
52 The name of an existing foreign\-data wrapper\&.
53 .RE
54 .PP
55 HANDLER \fIhandler_function\fR
56 .RS 4
57 Specifies a new handler function for the foreign\-data wrapper\&.
58 .RE
59 .PP
60 NO HANDLER
61 .RS 4
62 This is used to specify that the foreign\-data wrapper should no longer have a handler function\&.
63 .sp
64 Note that foreign tables that use a foreign\-data wrapper with no handler cannot be accessed\&.
65 .RE
66 .PP
67 VALIDATOR \fIvalidator_function\fR
68 .RS 4
69 Specifies a new validator function for the foreign\-data wrapper\&.
70 .sp
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\&.
72 PostgreSQL
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\&.
76 .RE
77 .PP
78 NO VALIDATOR
79 .RS 4
80 This is used to specify that the foreign\-data wrapper should no longer have a validator function\&.
81 .RE
82 .PP
83 OPTIONS ( [ ADD | SET | DROP ] \fIoption\fR [\*(Aq\fIvalue\fR\*(Aq] [, \&.\&.\&. ] )
84 .RS 4
85 Change options for the foreign\-data wrapper\&.
86 ADD,
87 SET, and
88 DROP
89 specify the action to be performed\&.
90 ADD
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\&.
92 .RE
93 .PP
94 \fInew_owner\fR
95 .RS 4
96 The user name of the new owner of the foreign\-data wrapper\&.
97 .RE
98 .PP
99 \fInew_name\fR
100 .RS 4
101 The new name for the foreign\-data wrapper\&.
102 .RE
103 .SH "EXAMPLES"
104 .PP
105 Change a foreign\-data wrapper
106 dbi, add option
107 foo, drop
108 bar:
109 .sp
110 .if n \{\
111 .RS 4
112 .\}
113 .nf
114 ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo \*(Aq1\*(Aq, DROP bar);
115 .fi
116 .if n \{\
117 .RE
118 .\}
119 .PP
120 Change the foreign\-data wrapper
121 dbi
122 validator to
123 bob\&.myvalidator:
124 .sp
125 .if n \{\
126 .RS 4
127 .\}
128 .nf
129 ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob\&.myvalidator;
130 .fi
131 .if n \{\
132 .RE
133 .\}
134 .SH "COMPATIBILITY"
135 .PP
136 \fBALTER FOREIGN DATA WRAPPER\fR
137 conforms to ISO/IEC 9075\-9 (SQL/MED), except that the
138 HANDLER,
139 VALIDATOR,
140 OWNER TO, and
141 RENAME
142 clauses are extensions\&.
143 .SH "SEE ALSO"
144 CREATE FOREIGN DATA WRAPPER (\fBCREATE_FOREIGN_DATA_WRAPPER\fR(7)), DROP FOREIGN DATA WRAPPER (\fBDROP_FOREIGN_DATA_WRAPPER\fR(7))