1
0
mirror of https://github.com/timescale/timescaledb.git synced 2025-05-17 02:53:51 +08:00
Matvey Arye a78f1570ba Remove dblink dependency.
The dblink extension is blacklisted by some cloud-hosting providers and
is an unnecessary dependency for single-node operation. Since we don't plan
to use dblink to implement clustering this PR removes the dependency.
2017-04-12 11:14:54 -04:00

47 lines
1.9 KiB
Plaintext

\o /dev/null
\ir include/create_single_db.sql
SET client_min_messages = WARNING;
DROP DATABASE IF EXISTS single;
SET client_min_messages = NOTICE;
CREATE DATABASE single;
\c single
CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;
psql:include/create_single_db.sql:7: NOTICE: installing required extension "postgres_fdw"
SELECT setup_timescaledb(hostname => 'fakehost'); -- fakehost makes sure there is no network connection
\o
-- Expect error when adding user again
\set ON_ERROR_STOP 0
SELECT add_cluster_user();
ERROR: User postgres already exists
\set ON_ERROR_STOP 1
-- Expect error when adding node again
CREATE TABLE PUBLIC."Hypertable_1" (
time BIGINT NOT NULL,
"Device_id" TEXT NOT NULL,
temp_c int NOT NULL DEFAULT -1
);
CREATE INDEX ON PUBLIC."Hypertable_1" (time, "Device_id");
\set ON_ERROR_STOP 0
SELECT * FROM create_hypertable('"public"."Hypertable_1_mispelled"', 'time', 'Device_id', 2);
ERROR: relation "public.Hypertable_1_mispelled" does not exist at character 33
SELECT * FROM create_hypertable('"public"."Hypertable_1"', 'time_mispelled', 'Device_id', 2);
ERROR: column "time_mispelled" does not exist
SELECT * FROM create_hypertable('"public"."Hypertable_1"', 'Device_id', 'Device_id', 2);
ERROR: illegal type for time column "Device_id": text
SELECT * FROM create_hypertable('"public"."Hypertable_1"', 'time', 'Device_id_mispelled', 2);
ERROR: column "Device_id_mispelled" does not exist
INSERT INTO PUBLIC."Hypertable_1" VALUES(1,'dev_1', 3);
SELECT * FROM create_hypertable('"public"."Hypertable_1"', 'time', 'Device_id', 2);
ERROR: the table being converted to a hypertable must be empty
DELETE FROM PUBLIC."Hypertable_1" ;
\set ON_ERROR_STOP 1
SELECT * FROM create_hypertable('"public"."Hypertable_1"', 'time', 'Device_id', 2);
create_hypertable
-------------------
(1 row)
\set ON_ERROR_STOP 0
SELECT * FROM create_hypertable('"public"."Hypertable_1"', 'time', 'Device_id', 2);
ERROR: hypertable "Hypertable_1" already exists