timescaledb_information.data_nodes

Get information on data nodes. This function is specific to running TimescaleDB in a multi-node setup.

Available columns

NameTypeDescription
node_nameTEXTData node name.
ownerREGCLASSOid of the user, who added the data node.
optionsJSONBOptions used when creating the data node.

Sample usage

Get metadata related to data nodes.

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

timescaledb_information.hypertables

Get metadata information about hypertables.

Available columns

NameTypeDescription
hypertable_schemaTEXTSchema name of the hypertable
hypertable_nameTEXTTable name of the hypertable
ownerTEXTOwner of the hypertable
num_dimensionsSMALLINTNumber of dimensions
num_chunksBIGINTNumber of chunks
compression_enabledBOOLEANIs compression enabled on the hypertable?
is_distributedBOOLEANIs the hypertable distributed?
replication_factorSMALLINTReplication factor for a distributed hypertable
data_nodesARRAYNodes on which hypertable is distributed
tablespacesARRAYTablespaces attached to the hypertable

Sample usage

Get information about a hypertable.

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