Create distributed hypertables

If you have a multi-node environment, you can create a distributed hypertable across your data nodes. First create a standard PostgreSQL table, and then convert it into a distributed hypertable.

important

You need to set up your multi-node cluster before creating a distributed hypertable. To set up multi-node, see the multi-node section.

Creating a distributed hypertable

  1. On the access node of your multi-node cluster, create a standard PostgreSQL table:

``` 1. CREATE TABLE conditions (

  1. time TIMESTAMPTZ NOT NULL,

  2. location TEXT NOT NULL,

  3. temperature DOUBLE PRECISION NULL,

  4. humidity DOUBLE PRECISION NULL

  5. ); ```

  6. Convert the table to a distributed hypertable. Specify the name of the table you want to convert, the column that holds its time values, and a space-partitioning parameter. For more information about space partitions, see the space-partitioning section.

1. SELECT create_distributed_hypertable('conditions', 'time', 'location');