timescaledb/test/sql/drop_rename_hypertable.sql
Erik Nordström 9023de61db Cleanup tests and make errors less verbose
Previously, each test set their own (although mostly the same)
configuration for log output and error verbosity. This is now set
globally in the test runner so that tests only need to set these
configuration parameters if they need to override the defaults.  The
log verbosity is also reduced so that errors aren't generated with the
line number of the source file that output the error. Line numbers in
the output can break tests when upgrading to a new PostgreSQL version
that outputs a different line number.
2017-03-23 22:56:03 +01:00

26 lines
600 B
SQL

\o /dev/null
\ir include/insert_two_partitions.sql
\o
\d+ "_timescaledb_internal".*
-- Test that renaming hypertable is blocked
\set VERBOSITY default
\set ON_ERROR_STOP 0
ALTER TABLE "two_Partitions" RENAME TO "newname";
\set ON_ERROR_STOP 1
-- Test that renaming ordinary table works
CREATE TABLE renametable (foo int);
ALTER TABLE "renametable" RENAME TO "newname";
SELECT * FROM "newname";
SELECT * FROM _timescaledb_catalog.hypertable;
DROP TABLE "two_Partitions";
SELECT * FROM _timescaledb_catalog.hypertable;
\dt "public".*
\dt "_timescaledb_catalog".*
\dt+ "_timescaledb_internal".*