timescaledb/test/sql/pg_dump_unprivileged.sql
Fabrízio de Royes Mello 0ae6f95646 Use DROP DATABASE ... WITH (FORCE) on tests
PG13 introduced an option to DROP DATABASE statement to terminate all
existing connections to the target database. Now that our minor
supported version is PG13 make sense to use it on regression tests in
order to avoid potential flaky tests.
2023-09-26 14:35:23 -03:00

23 lines
594 B
SQL

-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
\c template1 :ROLE_SUPERUSER
SET client_min_messages TO ERROR;
CREATE EXTENSION IF NOT EXISTS timescaledb;
RESET client_min_messages;
CREATE USER dump_unprivileged CREATEDB;
\c template1 dump_unprivileged
CREATE database dump_unprivileged;
\! utils/pg_dump_unprivileged.sh
\c template1 :ROLE_SUPERUSER
DROP EXTENSION timescaledb;
DROP DATABASE dump_unprivileged WITH (FORCE);
DROP USER dump_unprivileged;