timescaledb/tsl/test/sql/include/data_fetcher_load.sql
Sven Klemm b6510a063a Refactor regresscheck-t database creation
This patch removes hardcoded database names from regresscheck-t
and replaces it with database names derived from the test name.
This allows more of the regresscheck-t tests to be run in parallel
leading to a roughly 15% speedup of regresscheck-t.
This patch is also prerequisite for allowing repeatable
installchecklocal runs.
2021-03-09 09:04:09 +01:00

17 lines
849 B
SQL

-- This file and its contents are licensed under the Timescale License.
-- Please see the included NOTICE for copyright information and
-- LICENSE-TIMESCALE for a copy of the license.
SET ROLE :ROLE_CLUSTER_SUPERUSER;
SELECT * FROM add_data_node('data_node_1', host => 'localhost', database => :'DN_DBNAME_1');
SELECT * FROM add_data_node('data_node_2', host => 'localhost', database => :'DN_DBNAME_2');
SELECT * FROM add_data_node('data_node_3', host => 'localhost', database => :'DN_DBNAME_3');
CREATE TABLE disttable(time timestamptz, device int, temp float);
SELECT * FROM create_distributed_hypertable('disttable', 'time', 'device', 3);
SELECT setseed(1);
INSERT INTO disttable
SELECT t, (abs(timestamp_hash(t::timestamp)) % 10) + 1, random() * 10
FROM generate_series('2019-01-01'::timestamptz, '2019-01-02'::timestamptz, '1 second') as t;