Schema modifications

In TimescaleDB 2.1 and later, you can modify the table definition for hypertables with compressed chunks by adding nullable columns, and renaming existing columns.

Add nullable columns

To add a nullable column:

ALTER TABLE <hypertable> ADD COLUMN <column_name> <datatype>;

Note that adding constraints to the new column is not supported.

For example:

ALTER TABLE conditions ADD COLUMN device_id integer;

Rename columns

To rename a column:

ALTER TABLE <hypertable> RENAME <column_name> TO <new_name>;

For example:

ALTER TABLE conditions RENAME device_id TO devid;

Found an issue on this page?

Report an issue!


Related Content