Citus Tables and Views - Citus 13.0.1 documentation
Tables on all Nodes
Citus has other informational tables and views which are accessible on all nodes, not just the coordinator.
Connection Credentials Table
Note
This table is part of Citus Community edition as of version 11.0!
The pg_dist_authinfo table holds authentication parameters used by Citus nodes to connect to one another.
Name |
Type |
Description |
|---|---|---|
nodeid |
integer |
Node id from Worker node table, or 0, or -1 |
rolename |
name |
Postgres role |
authinfo |
text |
Space-separated libpq connection parameters |
Upon beginning a connection, a node consults the table to see whether a row with the destination nodeid and desired rolename exists. If so, the node includes the corresponding authinfo string in its libpq connection. A common example is to store a password, like 'password=abc123', but you can review the full list of possibilities.
The parameters in authinfo are space-separated, in the form key=val. To write an empty value, or a value containing spaces, surround it with single quotes, e.g., keyword='a value'. Single quotes and backslashes within the value must be escaped with a backslash, i.e., \' and \\.
The nodeid column can also take the special values 0 and -1, which mean all nodes or loopback connections, respectively. If, for a given node, both specific and all-node rules exist, the specific rule has precedence.
SELECT * FROM pg_dist_authinfo; nodeid | rolename | authinfo --------+----------+----------------- 123 | jdoe | password=abc123 (1 row)
Connection Pooling Credentials
Note
This table is part of Citus Community edition as of version 11.0!
If you want to use a connection pooler to connect to a node, you can specify the pooler options using pg_dist_poolinfo. This metadata table holds the host, port and database name for Citus to use when connecting to a node through a pooler.
If pool information is present, Citus will try to use these values instead of setting up a direct connection. The pg_dist_poolinfo information in this case supersedes pg_dist_node.
Name |
Type |
Description |
|---|---|---|
nodeid |
integer |
Node id from Worker node table |
poolinfo |
text |
Space-separated parameters: host, port, or dbname |
Note
In some situations Citus ignores the settings in pg_dist_poolinfo. For instance Shard rebalancing is not compatible with connection poolers such as pgbouncer. In these scenarios Citus will use a direct connection.
-- how to connect to node 1 (as identified in pg_dist_node) INSERT INTO pg_dist_poolinfo (nodeid, poolinfo) VALUES (1, 'host=127.0.0.1 port=5433');