]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Clean out column-level pg_init_privs entries when dropping tables.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Jun 2024 20:20:35 +0000 (16:20 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Jun 2024 20:20:35 +0000 (16:20 -0400)
commit1f1eedd3fa696f41ba426ebcd5de4fe08b5005cf
treefe7d2d518e62d92b5cd04e1a8a117f6f90390a6a
parentdf95c1ec0e988f4eb7d67fd7541501c894dfe082
Clean out column-level pg_init_privs entries when dropping tables.

DeleteInitPrivs did not get the memo about how, when dropping a
whole object (with subid == 0), you should drop entries relating
to its sub-objects too.  This is visible in the test_pg_dump test
case if one drops the extension at the end: the entry for
GRANT SELECT(col1) ON regress_pg_dump_table TO public;
was still present in pg_init_privs afterwards, although it was
pointing to a dangling table OID.

Noted while fooling with a fix for REASSIGN OWNED for pg_init_privs
entries.  This bug is aboriginal in the pg_init_privs feature
though, and there seems no reason not to back-patch the fix.
src/backend/catalog/dependency.c
src/test/modules/test_pg_dump/expected/test_pg_dump.out
src/test/modules/test_pg_dump/sql/test_pg_dump.sql