Alter a hypertable

You can alter a hypertable, for example to add a column, by using a standard ALTER TABLE command. This works for both regular and distributed hypertables.

In the following example, the hypertable is named conditions and the new column is named humidity:

  1. ALTER TABLE conditions
  2. ADD COLUMN humidity DOUBLE PRECISION NULL;
note

Adding a column is efficient so long as you set its default value to NULL. If you set the default to a non-null value, it takes longer, because TimescaleDB needs to fill in this value for all existing rows of all existing chunks.