Skip to content

Commit 988ddbe

Browse files
danielgustafssonmichaelpq
authored andcommitted
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 936e3fa, but the issue also exists in the 12~16 range. Discussion: https://postgr.es/m/E1phvk7-000VAH-7k@gemulon.postgresql.org Backpatch-through: 12
1 parent cf9f6b4 commit 988ddbe

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/test/modules/test_pg_dump/expected/test_pg_dump.out

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ ALTER EXTENSION test_pg_dump DROP SERVER s0;
9191
ALTER EXTENSION test_pg_dump DROP TABLE test_pg_dump_t1;
9292
ALTER EXTENSION test_pg_dump DROP TYPE test_pg_dump_e1;
9393
ALTER EXTENSION test_pg_dump DROP VIEW test_pg_dump_v1;
94+
DROP OWNED BY regress_dump_test_role RESTRICT;
95+
DROP ROLE regress_dump_test_role;
9496
DROP EXTENSION test_pg_dump;
9597
-- shouldn't be anything left in pg_init_privs
9698
SELECT * FROM pg_init_privs WHERE privtype = 'e';

src/test/modules/test_pg_dump/sql/test_pg_dump.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ ALTER EXTENSION test_pg_dump DROP TABLE test_pg_dump_t1;
107107
ALTER EXTENSION test_pg_dump DROP TYPE test_pg_dump_e1;
108108
ALTER EXTENSION test_pg_dump DROP VIEW test_pg_dump_v1;
109109

110+
DROP OWNED BY regress_dump_test_role RESTRICT;
111+
112+
DROP ROLE regress_dump_test_role;
113+
110114
DROP EXTENSION test_pg_dump;
111115

112116
-- shouldn't be anything left in pg_init_privs

0 commit comments

Comments
 (0)