Test that it works to RESET an invalid reloption
This works today, and it's valuable to ensure it doesn't get broken if/when we get around to refactoring the implementation. Author: Nikolay Shaplov <dhyan@nataraj.su> Discussion: https://postgr.es/m/4563991.km65PDbjlG@thinkpad-pgpro
This commit is contained in:
parent
b31ba5310b
commit
7db01fbcef
@ -87,6 +87,17 @@ SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass AND
|
|||||||
-- RESET fails if a value is specified
|
-- RESET fails if a value is specified
|
||||||
ALTER TABLE reloptions_test RESET (fillfactor=12);
|
ALTER TABLE reloptions_test RESET (fillfactor=12);
|
||||||
ERROR: RESET must not include values for parameters
|
ERROR: RESET must not include values for parameters
|
||||||
|
-- We can RESET an invalid option which for some reason is already set
|
||||||
|
UPDATE pg_class
|
||||||
|
SET reloptions = '{fillfactor=13,autovacuum_enabled=false,illegal_option=4}'
|
||||||
|
WHERE oid = 'reloptions_test'::regclass;
|
||||||
|
ALTER TABLE reloptions_test RESET (illegal_option);
|
||||||
|
SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass;
|
||||||
|
reloptions
|
||||||
|
------------------------------------------
|
||||||
|
{fillfactor=13,autovacuum_enabled=false}
|
||||||
|
(1 row)
|
||||||
|
|
||||||
-- Test vacuum_truncate option
|
-- Test vacuum_truncate option
|
||||||
DROP TABLE reloptions_test;
|
DROP TABLE reloptions_test;
|
||||||
CREATE TEMP TABLE reloptions_test(i INT NOT NULL, j text)
|
CREATE TEMP TABLE reloptions_test(i INT NOT NULL, j text)
|
||||||
|
@ -52,6 +52,13 @@ SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass AND
|
|||||||
-- RESET fails if a value is specified
|
-- RESET fails if a value is specified
|
||||||
ALTER TABLE reloptions_test RESET (fillfactor=12);
|
ALTER TABLE reloptions_test RESET (fillfactor=12);
|
||||||
|
|
||||||
|
-- We can RESET an invalid option which for some reason is already set
|
||||||
|
UPDATE pg_class
|
||||||
|
SET reloptions = '{fillfactor=13,autovacuum_enabled=false,illegal_option=4}'
|
||||||
|
WHERE oid = 'reloptions_test'::regclass;
|
||||||
|
ALTER TABLE reloptions_test RESET (illegal_option);
|
||||||
|
SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass;
|
||||||
|
|
||||||
-- Test vacuum_truncate option
|
-- Test vacuum_truncate option
|
||||||
DROP TABLE reloptions_test;
|
DROP TABLE reloptions_test;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user