mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-26 08:41:09 +08:00
This commit moves a lot of test setup logic to runner.sh. Also passes the right commands to the regression infrastructure to create appropriate users and run tests as a regular user.
38 lines
1.1 KiB
SQL
38 lines
1.1 KiB
SQL
CREATE TABLE drop_test(time timestamp, temp float8, device text);
|
|
|
|
SELECT create_hypertable('drop_test', 'time', 'device', 2);
|
|
SELECT * FROM _timescaledb_catalog.hypertable;
|
|
INSERT INTO drop_test VALUES('Mon Mar 20 09:17:00.936242 2017', 23.4, 'dev1');
|
|
SELECT * FROM drop_test;
|
|
|
|
\c single :ROLE_SUPERUSER
|
|
DROP EXTENSION timescaledb CASCADE;
|
|
\c single :ROLE_DEFAULT_PERM_USER
|
|
|
|
-- Querying the original table should not return any rows since all of
|
|
-- them actually existed in chunks that are now gone
|
|
SELECT * FROM drop_test;
|
|
|
|
\c single :ROLE_SUPERUSER
|
|
-- Recreate the extension
|
|
CREATE EXTENSION timescaledb;
|
|
|
|
-- Test that calling twice generates proper error
|
|
\set ON_ERROR_STOP 0
|
|
CREATE EXTENSION timescaledb;
|
|
\set ON_ERROR_STOP 1
|
|
\c single :ROLE_DEFAULT_PERM_USER
|
|
|
|
-- Make the table a hypertable again
|
|
SELECT create_hypertable('drop_test', 'time', 'device', 2);
|
|
|
|
SELECT * FROM _timescaledb_catalog.hypertable;
|
|
INSERT INTO drop_test VALUES('Mon Mar 20 09:18:19.100462 2017', 22.1, 'dev1');
|
|
SELECT * FROM drop_test;
|
|
|
|
--test drops thru cascades of other objects
|
|
\c single :ROLE_SUPERUSER
|
|
|
|
drop schema public cascade;
|
|
\dn
|