Creating a hypertable is a two-step process.
Create a standard table ([PostgreSQL docs][postgres-createtable]).
CREATE TABLE conditions ( time TIMESTAMPTZ NOT NULL, location TEXT NOT NULL, temperature DOUBLE PRECISION NULL );
SELECT create_hypertable('conditions', 'time');
If you need to migrate data from an existing table to a hypertable, make
sure to set the
migrate_data argument to
true when calling the function.
If you would like finer control over index formation and other aspects
of your hypertable, follow these migration instructions instead.
migrate_dataargument to convert a non-empty table can lock the table for a significant amount of time, depending on how much data is in the table.
create_hypertablefunction supports timestamp, date, or integer types, so you can use a parameter that is not explicitly time-based, as long as it can increment. For example, a monotonically increasing id would work.
Found an issue on this page?Report an issue!