postgres.git / summary / log / commit / refs

commit    8ec99d0b79b236c14660ff2f3beb6ee9747e8f5c
Author:   Daniel Gustafsson <dgustafsson@postgresql.org>
Commit:   Michael Paquier <michael@paquier.xyz>
Date:     Wed Apr 03 11:33:25 2024 +0000
First released in: 12.21, 13.17, 14.14, 15.9, 16.5

    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


src/test/modules/test_pg_dump/expected/test_pg_dump.out | 2 ++ src/test/modules/test_pg_dump/sql/test_pg_dump.sql | 4 ++++ 2 files changed, 6 insertions(+) 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 f2cf089f381..72b2d34c8d0 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 @@ -92,6 +92,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 44c5774a036..18a51c524b0 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 @@ -106,6 +106,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 [parent: 0ce8008386ca]