ALTER SERVER

Modify the definition of an external server.

Summary

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

describe

ALTER SERVER Changes the definition of an external server. The first form of the command changes the version string or common options of the server. The YMatrix database requires at least one clause. The second and third forms of this command change the owner or name of the server.

To change the server, you must be the owner of the server. To change the owner, the user must:

  • Owning a server.
  • Become a direct or indirect member of a new role.
  • Have USAGE privileges on the external data wrapper of the server.

Superusers automatically satisfy all these conditions.

Parameters

server_name

  • The name of the existing server.

new_version

  • New server version.

OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )

  • Change the options for the server. ADD, SET, and DROP Specifies the action to be performed. If no action is explicitly specified, the default action is ADD. The option name must be unique. The YMatrix database uses the server's external data wrapper library to verify names and values.

OWNER TO new_owner

  • Specify the new owner of the external server.

RENAME TO new_name

  • Specify the new name of the external server.

Example

Change the definition of a server named foo by adding a connection option:

ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');

Change the option named host for the server named foo and set the server version:

ALTER SERVER foo VERSION '9.1' OPTIONS (SET host 'baz');

compatibility

ALTER SERVER complies with ISO/IEC 9075-9 (SQL/MED). The OWNER TO and RENAME options are extensions to the YMatrix database.

See also

CREATE SERVER, DROP SERVER