Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7db01fb

Browse filesBrowse files
committed
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
1 parent b31ba53 commit 7db01fb
Copy full SHA for 7db01fb

File tree

Expand file treeCollapse file tree

2 files changed

+18
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+18
-0
lines changed

‎src/test/regress/expected/reloptions.out

Copy file name to clipboardExpand all lines: src/test/regress/expected/reloptions.out
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass AND
8787
-- RESET fails if a value is specified
8888
ALTER TABLE reloptions_test RESET (fillfactor=12);
8989
ERROR: RESET must not include values for parameters
90+
-- We can RESET an invalid option which for some reason is already set
91+
UPDATE pg_class
92+
SET reloptions = '{fillfactor=13,autovacuum_enabled=false,illegal_option=4}'
93+
WHERE oid = 'reloptions_test'::regclass;
94+
ALTER TABLE reloptions_test RESET (illegal_option);
95+
SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass;
96+
reloptions
97+
------------------------------------------
98+
{fillfactor=13,autovacuum_enabled=false}
99+
(1 row)
100+
90101
-- Test vacuum_truncate option
91102
DROP TABLE reloptions_test;
92103
CREATE TEMP TABLE reloptions_test(i INT NOT NULL, j text)

‎src/test/regress/sql/reloptions.sql

Copy file name to clipboardExpand all lines: src/test/regress/sql/reloptions.sql
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass AND
5252
-- RESET fails if a value is specified
5353
ALTER TABLE reloptions_test RESET (fillfactor=12);
5454

55+
-- We can RESET an invalid option which for some reason is already set
56+
UPDATE pg_class
57+
SET reloptions = '{fillfactor=13,autovacuum_enabled=false,illegal_option=4}'
58+
WHERE oid = 'reloptions_test'::regclass;
59+
ALTER TABLE reloptions_test RESET (illegal_option);
60+
SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass;
61+
5562
-- Test vacuum_truncate option
5663
DROP TABLE reloptions_test;
5764

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.