mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-16 02:23:49 +08:00
Running ALTER TABLE SET with multiple SET clauses on a regular PostgreSQL table produces irrelevant error when timescaledb extension is installed. Fix #5641
36 lines
1.3 KiB
SQL
36 lines
1.3 KiB
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.
|
|
|
|
CREATE TABLE reloptions_test(time integer, temp float8, color integer)
|
|
WITH (fillfactor=75, autovacuum_vacuum_threshold=100);
|
|
|
|
SELECT create_hypertable('reloptions_test', 'time', chunk_time_interval => 3);
|
|
|
|
INSERT INTO reloptions_test VALUES (4, 24.3, 1), (9, 13.3, 2);
|
|
|
|
-- Show that reloptions are inherited by chunks
|
|
SELECT relname, reloptions FROM pg_class
|
|
WHERE relname ~ '^_hyper.*' AND relkind = 'r';
|
|
|
|
-- Alter reloptions
|
|
ALTER TABLE reloptions_test SET (fillfactor=80, parallel_workers=8);
|
|
|
|
\set ON_ERROR_STOP 0
|
|
ALTER TABLE reloptions_test SET (fillfactor=80), SET (parallel_workers=8);
|
|
\set ON_ERROR_STOP 1
|
|
|
|
SELECT relname, reloptions FROM pg_class
|
|
WHERE relname ~ '^_hyper.*' AND relkind = 'r';
|
|
|
|
ALTER TABLE reloptions_test RESET (fillfactor);
|
|
|
|
SELECT relname, reloptions FROM pg_class
|
|
WHERE relname ~ '^_hyper.*' AND relkind = 'r';
|
|
|
|
-- Test reloptions on a regular table
|
|
CREATE TABLE reloptions_test2(time integer, temp float8, color integer);
|
|
ALTER TABLE reloptions_test2 SET (fillfactor=80, parallel_workers=8);
|
|
ALTER TABLE reloptions_test2 SET (fillfactor=80), SET (parallel_workers=8);
|
|
DROP TABLE reloptions_test2;
|