Skip to content

Commit e43e71b

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 77930c5 commit e43e71b

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
@@ -93,6 +93,8 @@ ALTER EXTENSION test_pg_dump DROP SERVER s0;
9393
ALTER EXTENSION test_pg_dump DROP TABLE test_pg_dump_t1;
9494
ALTER EXTENSION test_pg_dump DROP TYPE test_pg_dump_e1;
9595
ALTER EXTENSION test_pg_dump DROP VIEW test_pg_dump_v1;
96+
DROP OWNED BY regress_dump_test_role RESTRICT;
97+
DROP ROLE regress_dump_test_role;
9698
DROP EXTENSION test_pg_dump;
9799
-- shouldn't be anything left in pg_init_privs
98100
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)