ALTER SERVER

An SQL command for modifying the properties of a foreign server

ALTER SERVER is a DDL command for modifying the properties of a foreign server.

ALTER SERVER was added in PostgreSQL 8.4.

Change history

Examples

Using ALTER SERVER to modify the options for the foreign server (here: postgres_fdw):

postgres=# ALTER SERVER pg_fdw_test OPTIONS (ADD use_remote_estimate 'true');
ALTER SERVER

postgres=# ALTER SERVER pg_fdw_test OPTIONS (SET use_remote_estimate 'false');
ALTER SERVER

postgres=# ALTER SERVER pg_fdw_test OPTIONS (DROP use_remote_estimate);
ALTER SERVER

Note that the SET clause is only accepted if an option was explicitly specified when executing CREATE SERVER or subsequently specified with ADD:

postgres=# ALTER SERVER pg_fdw_test OPTIONS (SET use_remote_estimate 'true');
ERROR:  option "use_remote_estimate" not found

Categories

DDL, Foreign Data Wrapper (FDW), SQL command

See also

CREATE SERVER, DROP SERVER, pg_foreign_server