Changes the definition of a foreign server.
ALTER SERVER <server_name> [ VERSION '<new_version>' ]
[ OPTIONS ( [ ADD | SET | DROP ] <option> ['<value>'] [, ... ] ) ]
ALTER SERVER <server_name> OWNER TO <new_owner>
ALTER SERVER <server_name> RENAME TO <new_name>
ALTER SERVER
changes the definition of a foreign server. The first form of the command changes the version string or the generic options of the server. Greenplum Database requires at least one clause. The second and third forms of the command change the owner or the name of the server.
To alter the server, you must be the owner of the server. To alter the owner you must:
USAGE
privilege on the server's foreign-data wrapper.Superusers automatically satisfy all of these criteria.
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 server's foreign-data wrapper library.
Change the definition of a server named foo
by adding connection options:
ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');
Change the option named host
for a server named foo
, and set the server version:
ALTER SERVER foo VERSION '9.1' OPTIONS (SET host 'baz');
ALTER SERVER
conforms to ISO/IEC 9075-9 (SQL/MED). The OWNER TO
and RENAME
forms are Greenplum Database extensions.
Parent topic: SQL Commands