ALTER SERVER

Function

ALTER SERVER adds, modifies, or deletes the parameters of an existing server. You can query existing servers from the pg_foreign_server system catalog.

Precautions

Only the owner of a server or a system administrator can run this statement.

Syntax

1
2
ALTER SERVER server_name [ VERSION 'new_version' ]
    [ OPTIONS ( {[ ADD | SET | DROP ] option ['value']} [, ... ] ) ];

In OPTIONS, ADD, SET, and DROP are operations to be executed. If these operations are not specified, the ADD operation will be performed by default. option and value are corresponding operation parameters.

Currently, only SET is supported on an HDFS server. ADD and DROP are not supported. The syntax for SET and DROP operations is retained for later use.

1
2
ALTER SERVER server_name 
    OWNER TO new_owner;
1
2
ALTER SERVER server_name 
    RENAME TO new_name;
1
ALTER SERVER server_name REFRESH OPTIONS;

Parameter Description

The server parameters to be modified are as follows:

Examples

Change the current name to the IP address of the hdfs_server server.

ALTER SERVER hdfs_server OPTIONS ( SET address '10.10.0.110:25000,10.10.0.120:25000');

Change the current name to hdfscfgpath of the hdfs_server server.

ALTER SERVER hdfs_server OPTIONS ( SET hdfscfgpath '/opt/bigdata/hadoop');

Helpful Links

CREATE SERVER DROP SERVER