Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Drop global objects after completed test
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Wed, 3 Apr 2024 11:33:25 +0000 (13:33 +0200)
committerMichael Paquier <michael@paquier.xyz>
Tue, 24 Sep 2024 03:10:25 +0000 (12:10 +0900)
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

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

index 8df7f09054416ac7a4ae6ef251d23a449c1edac6..ea8daf01130aee858c6eab086124f6b76ed7dd98 100644 (file)
@@ -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';
index 7f2e7d32f6dbabd28725e49ff916eea7ad3df2be..5c0a3a2058b62a94c0d524a2102fd9a5a5e30c23 100644 (file)
@@ -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