diff options
| author | Álvaro Herrera | 2025-03-14 08:28:51 +0000 |
|---|---|---|
| committer | Álvaro Herrera | 2025-03-14 08:28:51 +0000 |
| commit | 1548c3a30436dd825cfbf57923c6766b2fddd355 (patch) | |
| tree | 5f16b75f88f5c4cc868f50841d59d0c5990337b3 /src/test | |
| parent | 92fc6856cb4c598f99c58b862bc34aebc6f2ec25 (diff) | |
Remove direct handling of reloptions for toast tables
It doesn't actually work, even with allow_system_table_mods turned on:
the ALTER TABLE operation is rejected by ATSimplePermissions(), so even
the error message we're adding in this commit is unreachable.
Add a test case for it.
Author: Nikolay Shaplov <dhyan@nataraj.su>
Discussion: https://postgr.es/m/1913854.tdWV9SEqCh@thinkpad-pgpro
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/modules/unsafe_tests/expected/alter_system_table.out | 7 | ||||
| -rw-r--r-- | src/test/modules/unsafe_tests/sql/alter_system_table.sql | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/test/modules/unsafe_tests/expected/alter_system_table.out b/src/test/modules/unsafe_tests/expected/alter_system_table.out index be0559503b6..b73b9442b8d 100644 --- a/src/test/modules/unsafe_tests/expected/alter_system_table.out +++ b/src/test/modules/unsafe_tests/expected/alter_system_table.out @@ -91,6 +91,9 @@ ERROR: permission denied: "pg_description" is a system catalog SET allow_system_table_mods TO on; DROP RULE r2 ON pg_description; RESET allow_system_table_mods; +-- Reloptions on TOAST tables +ALTER TABLE pg_toast.pg_toast_2615 SET (fillfactor = '90'); +ERROR: permission denied: "pg_toast_2615" is a system catalog SET allow_system_table_mods = on; -- create new table in pg_catalog BEGIN; @@ -173,6 +176,10 @@ DROP TRIGGER t2 ON pg_description; CREATE RULE r1 AS ON INSERT TO pg_description DO INSTEAD NOTHING; ALTER RULE r1 ON pg_description RENAME TO r2; DROP RULE r2 ON pg_description; +-- Reloptions on TOAST tables +ALTER TABLE pg_toast.pg_toast_2615 SET (fillfactor = '90'); +ERROR: ALTER action SET cannot be performed on relation "pg_toast_2615" +DETAIL: This operation is not supported for TOAST tables. -- cleanup REVOKE ALL ON pg_description FROM regress_user_ast; DROP USER regress_user_ast; diff --git a/src/test/modules/unsafe_tests/sql/alter_system_table.sql b/src/test/modules/unsafe_tests/sql/alter_system_table.sql index b77b68c946a..c1515100845 100644 --- a/src/test/modules/unsafe_tests/sql/alter_system_table.sql +++ b/src/test/modules/unsafe_tests/sql/alter_system_table.sql @@ -89,6 +89,8 @@ SET allow_system_table_mods TO on; DROP RULE r2 ON pg_description; RESET allow_system_table_mods; +-- Reloptions on TOAST tables +ALTER TABLE pg_toast.pg_toast_2615 SET (fillfactor = '90'); SET allow_system_table_mods = on; @@ -187,6 +189,8 @@ CREATE RULE r1 AS ON INSERT TO pg_description DO INSTEAD NOTHING; ALTER RULE r1 ON pg_description RENAME TO r2; DROP RULE r2 ON pg_description; +-- Reloptions on TOAST tables +ALTER TABLE pg_toast.pg_toast_2615 SET (fillfactor = '90'); -- cleanup REVOKE ALL ON pg_description FROM regress_user_ast; |
