
# PGXC_NODE
PGXC_NODE系统表存储集群节点信息。
表1PGXC_NODE字段 
| 名称               | 类型      | 描述                                                                                                                                                        |
|:---|:---|:---|
| node_name        | name    | 节点名称。                                                                                                                                                     |
| node_type        | "char"  | 节点类型。 C：协调节点。 D：数据节点。 |
| node_port        | integer | 节点的端口号。                                                                                                                                                   |
| node_host        | name    | 节点的主机名称或者IP（如配置为虚拟IP，则为虚拟IP）。                                                                                                                             |
| node_port1       | integer | 复制节点的端口号。                                                                                                                                                 |
| node_host1       | name    | 复制节点的主机名称或者IP（如配置为虚拟IP，则为虚拟IP）。                                                                                                                           |
| hostis_primary   | boolean | 表明当前节点是否发生主备切换。                                                                                                                                           |
| nodeis_primary   | boolean | 在replication表下，是否优选当前节点作为优先执行的节点进行非查询操作。                                                                                                                  |
| nodeis_preferred | boolean | 在replication表下，是否优选当前节点作为首选的节点进行查询。                                                                                                                       |
| node_id          | integer | 节点标识符。                                                                                                                                                    |
| sctp_port        | integer | 主节点使用TCP代理通信库或SCTP通信库的数据通道监听端口。                                                                                                                           |
| control_port     | integer | 主节点使用TCP代理通信库或SCTP通信库的控制通道监听端口。                                                                                                                           |
| sctp_port1       | integer | 备节点使用TCP代理通信库或SCTP通信库的数据通道监听端口。                                                                                                                           |
| control_port1    | integer | 备节点使用TCP代理通信库或SCTP通信库的控制通道监听端口。                                                                                                                           |
| nodeis_central   | boolean | 当前节点为中心控制节点。                                                                                                                                              |
   
#### 应用示例
查询集群的CN和DN信息：
```
SELECT * FROM pgxc_node;
  node_name   | node_type | node_port | node_host | node_port1 | node_host1 | hostis_primary | nodeis_primary | nodeis_preferred |   node_id  
 | sctp_port | control_port | sctp_port1 | control_port1 | nodeis_central | read_only 
--------------+-----------+-----------+-----------+------------+------------+----------------+----------------+------------------+------------
-+-----------+--------------+------------+---------------+----------------+-----------
 datanode1    | D         |     55504 | localhost |      55504 | localhost  | t              | f              | f                |   888802358
 |     55505 |        55507 |          0 |             0 | f              | f
 datanode2    | D         |     55508 | localhost |      55508 | localhost  | t              | f              | f                |  -905831925
 |     55509 |        55511 |          0 |             0 | f              | f
 coordinator1 | C         |     55500 | localhost |      55500 | localhost  | t              | f              | f                |  1938253334
 |         0 |            0 |          0 |             0 | t              | f
 datanode3    | D         |     55542 | localhost |      55542 | localhost  | t              | f              | f                | -1894792127
 |     57552 |        55544 |          0 |             0 | f              | t
 datanode4    | D         |     55546 | localhost |      55546 | localhost  | t              | f              | f                | -1307323892
 |     57808 |        55548 |          0 |             0 | f              | t
 datanode5    | D         |     55550 | localhost |      55550 | localhost  | t              | f              | f                |  1797586929
 |     58064 |        55552 |          0 |             0 | f              | t
 datanode6    | D         |     55554 | localhost |      55554 | localhost  | t              | f              | f                |   587455710
 |     58320 |        55556 |          0 |             0 | f              | t
 datanode7    | D         |     55558 | localhost |      55558 | localhost  | t              | f              | f                | -1685037427
 |     58576 |        55560 |          0 |             0 | f              | t
 datanode8    | D         |     55562 | localhost |      55562 | localhost  | t              | f              | f                |  -993847320
 |     58832 |        55564 |          0 |             0 | f              | t
(9 rows)
```
