aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2023-12-08 11:58:58 +0100
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2023-12-08 11:58:58 +0100
commit7db01fbcefbd95a7c97afa128fab59f4a09b3ff1 (patch)
tree4441a95fef5f40e85047c9f6b91462adc6aa64b3 /src
parentb31ba5310b5176402b60abc0454a033b1210ab75 (diff)
downloadpostgresql-7db01fbcefbd95a7c97afa128fab59f4a09b3ff1.tar.gz
postgresql-7db01fbcefbd95a7c97afa128fab59f4a09b3ff1.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/reloptions.out11
-rw-r--r--src/test/regress/sql/reloptions.sql7
2 files changed, 18 insertions, 0 deletions
diff --git a/src/test/regress/expected/reloptions.out b/src/test/regress/expected/reloptions.out
index b6aef6f654c..9de19b4e3f1 100644
--- a/src/test/regress/expected/reloptions.out
+++ b/src/test/regress/expected/reloptions.out
@@ -87,6 +87,17 @@ SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass AND
-- RESET fails if a value is specified
ALTER TABLE reloptions_test RESET (fillfactor=12);
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
DROP TABLE reloptions_test;
CREATE TEMP TABLE reloptions_test(i INT NOT NULL, j text)
diff --git a/src/test/regress/sql/reloptions.sql b/src/test/regress/sql/reloptions.sql
index 4252b0202f4..24fbe0b478d 100644
--- a/src/test/regress/sql/reloptions.sql
+++ b/src/test/regress/sql/reloptions.sql
@@ -52,6 +52,13 @@ SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass AND
-- RESET fails if a value is specified
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
DROP TABLE reloptions_test;