ALTER NODE

Name

ALTER NODE -- alter a cluster node

Synopsis

ALTER NODE nodename WITH
  (
    [ TYPE = nodetype,]
    [ HOST = hostname,]
    [ PORT = portnum,]
    [ PRIMARY,]
    [ PREFERRED ]
  )

Description

Note: The following description applies only to Postgres-XC

ALTER NODE is new SQL query specific to Postgres-XC since 0.9.7 that modifies cluster node information in catalog pgxc_node.

Node connection that has been modified does not guarranty that connection information cached in pooler is updated accordingly.

ALTER NODE only runs on the local node where it is launched.

Parameters

nodename

The name of the selected cluster node.

TYPE

The type of the cluster node. It is possible to specify a Coordinator node or a Datanode node.

PRIMARY

Defines if the cluster node is used as a primary for replicated write operations.

PREFERRED

Defines if the cluster node is used as a preferely for replicated read operations.

nodetype

The node type for given cluster node. Possible values are: 'coordinator' for a Coordinator node and 'datanode' for a Datanode node.

hostname

The hostname or IP used to connect to the cluster node.

portnum

The port number used to connect to the cluster node.

Notes

A Datanode can be modified as PRIMARY and as PREFERRED as many times as necessary.

A node type cannot be modified.

Examples

Modify a Coordinator node located on local machine to use port 6543.

ALTER NODE coord_node WITH (PORT = 6543, HOST = 'localhost');

Compatibility

ALTER NODE does not conform to the SQL standards, it is a Postgres-XC specific command.