timescaledb/test/sql/plain.sql
Erik Nordström 500563ffe5 Add support for PostgreSQL 10
The extension now works with PostgreSQL 10, while
retaining compatibility with version 9.6.

PostgreSQL 10 has numerous internal changes to functions and
APIs, which necessitates various glue code and compatibility
wrappers to seamlessly retain backwards compatiblity with older
versions.

Test output might also differ between versions. In particular,
the psql client generates version-specific output with `\d` and
EXPLAINs might differ due to new query optimizations. The test
suite has been modified as follows to handle these issues. First,
tests now use version-independent functions to query system
catalogs instead of using `\d`. Second, changes have been made to
the test suite to be able to verify some test outputs against
version-dependent reference files.
2017-11-10 09:44:20 +01:00

29 lines
966 B
SQL

-- Tests for plain PostgreSQL commands to ensure that they work while
-- the TimescaleDB extension is loaded. This is a mix of statements
-- added mostly as regression checks when bugs are discovered and
-- fixed.
CREATE TABLE regular_table(time timestamp, temp float8, tag text, color integer);
-- Renaming indexes should work
CREATE INDEX time_color_idx ON regular_table(time, color);
ALTER INDEX time_color_idx RENAME TO time_color_idx2;
ALTER TABLE regular_table ALTER COLUMN color TYPE bigint;
SELECT * FROM test.show_columns('regular_table');
SELECT * FROM test.show_indexes('regular_table');
-- Renaming types should work
CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple');
ALTER TYPE rainbow RENAME TO colors;
\dT+
REINDEX TABLE regular_table;
\c single :ROLE_SUPERUSER
REINDEX SCHEMA public;
-- Not only simple statements should work
CREATE TABLE a (aa TEXT);
CREATE TABLE z (b TEXT, PRIMARY KEY(aa, b)) inherits (a);