获取关于数据节点的信息。此功能特定于在多节点设置中运行 TimescaleDB。

警告

多节点支持已弃用.

TimescaleDB v2.13 是最后一个包含 PostgreSQL 版本 13、14 和 15 的多节点支持的版本。

名称类型描述
node_name文本数据节点名称。
ownerREGCLASS添加数据节点的用户 Oid。
optionsJSONB创建数据节点时使用的选项。

获取与数据节点相关的元数据。

SELECT * FROM timescaledb_information.data_nodes;
node_name | owner | options
--------------+------------+--------------------------------
dn1 | postgres | {host=localhost,port=15431,dbname=test}
dn2 | postgres | {host=localhost,port=15432,dbname=test}
(2 rows)

获取关于超表的元数据信息。

名称类型描述
hypertable_schema文本超表的模式名称
hypertable_name文本超表的表名称
owner文本超表的所有者
num_dimensionsSMALLINT维度数量
num_chunksBIGINT数据块数量
compression_enabledBOOLEAN超表是否启用了压缩?
is_distributedBOOLEAN超表是否是分布式的?
replication_factorSMALLINT分布式超表的复制因子
data_nodesARRAY超表分布在哪些节点上
tablespacesARRAY附加到超表的表空间

获取关于超表的信息。

CREATE TABLE dist_table(time timestamptz, device int, temp float);
SELECT create_distributed_hypertable('dist_table', 'time', 'device', replication_factor => 2);
SELECT * FROM timescaledb_information.hypertables
WHERE hypertable_name = 'dist_table';
-[ RECORD 1 ]-------+-----------
hypertable_schema | public
hypertable_name | dist_table
owner | postgres
num_dimensions | 2
num_chunks | 3
compression_enabled | f
is_distributed | t
replication_factor | 2
data_nodes | {node_1, node_2}
tablespaces |

关键词

在此页面上发现问题?报告问题 或 在 GitHub 上编辑此页面