Postgres-XC 1.1 Documentation
Prev | Up |  | Next

# ALTER NODE

## Name

ALTER NODE -- alter a cluster node

## Synopsis

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

## 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 guaranty 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 node for replicated write operations. A `boolean` value can be specified. In case no value is specified, `PRIMARY` acts like `true`.

`PREFERRED`

  Defines if the cluster node is used as a preferred node for replicated read operations. A `boolean` value can be specified. In case no value is specified, `PREFERRED` acts like `true`.

`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.

Prev | Home | Next
ALTER LARGE OBJECT | Up | ALTER OPERATOR