Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit7db01fb

Browse files
committed
Test that it works to RESET an invalid reloption
This works today, and it's valuable to ensure it doesn't get brokenif/when we get around to refactoring the implementation.Author: Nikolay Shaplov <dhyan@nataraj.su>Discussion:https://postgr.es/m/4563991.km65PDbjlG@thinkpad-pgpro
1 parentb31ba53 commit7db01fb

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

Lines 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

Lines 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
ALTERTABLE 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+
WHEREoid='reloptions_test'::regclass;
59+
ALTERTABLE reloptions_test RESET (illegal_option);
60+
SELECT reloptionsFROM pg_classWHEREoid='reloptions_test'::regclass;
61+
5562
-- Test vacuum_truncate option
5663
DROPTABLE reloptions_test;
5764

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp