diff options
author | Daniel Gustafsson <dgustafsson@postgresql.org> | 2024-04-03 13:33:25 +0200 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2024-09-24 12:10:18 +0900 |
commit | 4dd17490faa34c2dc4725593f7866c3f18f76e7d (patch) | |
tree | 33bbcb348276ea130a2c387b6aea7e25ec6a7714 | |
parent | 8e16522163efce0e2d75b6e8c4413be22e637550 (diff) | |
download | postgresql-4dd17490faa34c2dc4725593f7866c3f18f76e7d.tar.gz postgresql-4dd17490faa34c2dc4725593f7866c3f18f76e7d.zip |
Drop global objects after completed test
Project policy is to not leave global objects behind after a regress
test run. This was found as a result of the development of a patch
to make pg_regress detect such leftovers automatically, which in the
end was withdrawn due to issues with parallel runs.
This was originally committed as 936e3fa3787a, but the issue also exists
in the 12~16 range.
Discussion: https://postgr.es/m/E1phvk7-000VAH-7k@gemulon.postgresql.org
Backpatch-through: 12
-rw-r--r-- | src/test/modules/test_pg_dump/expected/test_pg_dump.out | 2 | ||||
-rw-r--r-- | src/test/modules/test_pg_dump/sql/test_pg_dump.sql | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/test/modules/test_pg_dump/expected/test_pg_dump.out b/src/test/modules/test_pg_dump/expected/test_pg_dump.out index 8df7f090544..ea8daf01130 100644 --- a/src/test/modules/test_pg_dump/expected/test_pg_dump.out +++ b/src/test/modules/test_pg_dump/expected/test_pg_dump.out @@ -91,6 +91,8 @@ ALTER EXTENSION test_pg_dump DROP SERVER s0; ALTER EXTENSION test_pg_dump DROP TABLE test_pg_dump_t1; ALTER EXTENSION test_pg_dump DROP TYPE test_pg_dump_e1; ALTER EXTENSION test_pg_dump DROP VIEW test_pg_dump_v1; +DROP OWNED BY regress_dump_test_role RESTRICT; +DROP ROLE regress_dump_test_role; DROP EXTENSION test_pg_dump; -- shouldn't be anything left in pg_init_privs SELECT * FROM pg_init_privs WHERE privtype = 'e'; diff --git a/src/test/modules/test_pg_dump/sql/test_pg_dump.sql b/src/test/modules/test_pg_dump/sql/test_pg_dump.sql index 7f2e7d32f6d..5c0a3a2058b 100644 --- a/src/test/modules/test_pg_dump/sql/test_pg_dump.sql +++ b/src/test/modules/test_pg_dump/sql/test_pg_dump.sql @@ -107,6 +107,10 @@ ALTER EXTENSION test_pg_dump DROP TABLE test_pg_dump_t1; ALTER EXTENSION test_pg_dump DROP TYPE test_pg_dump_e1; ALTER EXTENSION test_pg_dump DROP VIEW test_pg_dump_v1; +DROP OWNED BY regress_dump_test_role RESTRICT; + +DROP ROLE regress_dump_test_role; + DROP EXTENSION test_pg_dump; -- shouldn't be anything left in pg_init_privs |