ALTER FOREIGN DATA WRAPPER
This page documents the preview version (v2.23). Preview includes features under active development and is for development and testing only. For production, use the stable version (v2024.1). To learn more, see Versioning.
Synopsis
Use the ALTER FOREIGN DATA WRAPPER
command to alter the definition of the foreign-data wrapper. This command can be used to alter the handler/validator functions or the options of the foreign-data wrapper. It can also be used to change the owner or rename the foreign-data wrapper.
Syntax
alter_foreign_data_wrapper ::= ALTER FOREIGN DATA WRAPPER fdw_name
[ HANDLER handler_name | NO HANDLER ]
[ VALIDATOR validator_name
| NO VALIDATOR ]
[ OPTIONS ( alter_fdw_options ) ]
[ OWNER TO new_owner ]
[ RENAME TO new_name ]
Semantics
Alter the foreign-data wrapper named fdw_name.
Handler:
The HANDLER
clause can be used to specify the handler function.
The NO HANDLER
clause can be used to specify that the foreign-data wrapper has no handler function.
Validator
The VALIDATOR
clause can be used to specify the validator function.
The NO VALIDATOR
can be used to specify that the foreign-data wrapper has no validator function.
Options
The OPTIONS
clause can be used to specify the new options of the foreign-data wrapper. ADD
, SET
, and DROP
specify the action to be performed. ADD
is assumed if no operation is explicitly specified.
The new owner of the FDW can be specified using new_owner The new name of the FDW can be specified using new_name
Examples
Change the handler to newhandler
.
yugabyte=# ALTER FOREIGN DATA WRAPPER my_wrapper HANDLER;
Alter the foreign-data wrapper to have no validator.
yugabyte=# ALTER FOREIGN DATA WRAPPER my_wrapper NO VALIDATOR;
Alter the foreign-data wrapper's options: add new
and set it to '1'
, change the value of old
to '2'
.
yugabyte=# ALTER FOREIGN DATA WRAPPER my_wrapper OPTIONS(ADD new '1', SET old '2');