Erik Nordström d87a6ee5a0 Allow partitioning in only time dimension
This allows creating hypertables as follows:
```
CREATE TABLE only_1dim(time timestamp, temp float);
SELECT create_hypertable('only_1dim', 'time');
INSERT INTO only_1dim VALUES('2017-01-12T08:11:03', 23.4);
```

It is implemented by making the specification of a partitioning column
optional, and when NULL the number of partitions will be set to 1.
2017-01-26 11:57:22 +01:00

19 lines
527 B
SQL

\set ON_ERROR_STOP 1
\set ECHO ALL
\ir include/insert_single.sql
\c single
\d+ "testNs".*
SELECT *
FROM "testNs"._hyper_1_0_distinct;
SELECT * FROM "testNs";
--test that we can insert data into a 1-dimensional table (only time partitioning)
CREATE TABLE "1dim"(time timestamp, temp float);
SELECT create_hypertable('"1dim"', 'time');
INSERT INTO "1dim" VALUES('2017-01-20T09:00:01', 22.5);
INSERT INTO "1dim" VALUES('2017-01-20T09:00:21', 21.2);
INSERT INTO "1dim" VALUES('2017-01-20T09:00:47', 25.1);
SELECT * FROM "1dim";