From 334e302c8cc0429f086d1f681154b690c506da79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Nordstr=C3=B6m?= Date: Wed, 25 Jan 2017 12:00:43 +0100 Subject: [PATCH] Allow partition epochs to start and end at time 0. This aligns the partition epoch table with the chunk table, which allows data in chunks to start and end at time 0. --- extension/sql/common/tables.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extension/sql/common/tables.sql b/extension/sql/common/tables.sql index d32d9de39..0b2235203 100644 --- a/extension/sql/common/tables.sql +++ b/extension/sql/common/tables.sql @@ -150,14 +150,14 @@ SELECT pg_catalog.pg_extension_config_dump('_iobeamdb_catalog.distinct_replica_n CREATE TABLE IF NOT EXISTS _iobeamdb_catalog.partition_epoch ( id SERIAL NOT NULL PRIMARY KEY, hypertable_id INTEGER NOT NULL REFERENCES _iobeamdb_catalog.hypertable(id) ON DELETE CASCADE, - start_time BIGINT NULL CHECK (start_time > 0), - end_time BIGINT NULL CHECK (end_time > 0), + start_time BIGINT NULL CHECK (start_time >= 0), + end_time BIGINT NULL CHECK (end_time >= 0), partitioning_func NAME NULL, --function name of a function of the form func(data_value, partitioning_mod) -> [0, partitioning_mod) partitioning_mod INT NOT NULL CHECK (partitioning_mod < 65536), partitioning_column NAME NULL, UNIQUE (hypertable_id, start_time), UNIQUE (hypertable_id, end_time), - CHECK (start_time < end_time) + CHECK (start_time <= end_time) ); SELECT pg_catalog.pg_extension_config_dump('_iobeamdb_catalog.partition_epoch', ''); SELECT pg_catalog.pg_extension_config_dump(pg_get_serial_sequence('_iobeamdb_catalog.partition_epoch','id'), '');