Changes the definition of a foreign-data wrapper.
ALTER FOREIGN DATA WRAPPER <name>
[ HANDLER <handler_function> | NO HANDLER ]
[ VALIDATOR <validator_function> | NO VALIDATOR ]
[ OPTIONS ( [ ADD | SET | DROP ] <option> ['<value>'] [, ... ] ) ]
ALTER FOREIGN DATA WRAPPER <name> OWNER TO { <new_owner> | CURRENT_USER | SESSION_USER }
ALTER FOREIGN DATA WRAPPER <name> RENAME TO <new_name>
ALTER FOREIGN DATA WRAPPER
changes the definition of a foreign-data wrapper. The first form of the command changes the support functions or generic options of the foreign-data wrapper. Greenplum Database requires at least one clause. The second and third forms of the command change the owner or name of the foreign-data wrapper.
Only superusers can alter foreign-data wrappers. Additionally, only superusers can own foreign-data wrappers
Specifies that the foreign-data wrapper should no longer have a handler function.
NoteYou cannot access a foreign table that uses a foreign-data wrapper with no handler.
Specifies a new validator function for the foreign-data wrapper.
ALTER FOREIGN DATA WRAPPER
command using the new validator.
ADD
,
SET
, and
DROP
specify the action to perform. If no operation is explicitly specified, the default operation is
ADD
. Option names must be unique. Greenplum Database validates names and values using the foreign-data wrapper's validator function, if any.
Change the definition of a foreign-data wrapper named dbi
by adding a new option named foo
, and removing the option named bar
:
ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo '1', DROP 'bar');
Change the validator function for a foreign-data wrapper named dbi
to bob.myvalidator
:
ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob.myvalidator;
ALTER FOREIGN DATA WRAPPER
conforms to ISO/IEC 9075-9 (SQL/MED), with the exception that the HANDLER
, VALIDATOR
, OWNER TO
, and RENAME TO
clauses are Greenplum Database extensions.
CREATE FOREIGN DATA WRAPPER, DROP FOREIGN DATA WRAPPER
Parent topic: SQL Commands