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:

ALTER TABLE conditions
  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.

Found an issue on this page?

Report an issue!

Keywords

Related Content