From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Clean out column-level pg_init_privs entries when dropping table
Date: Fri, 14 Jun 2024 20:20:53 +0000
Message-ID: <E1sIDPo-001WhL-V0@gemulon.postgresql.org> (raw)
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.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/76618097a6c027ec603a3dd143f61098e3fb9794
Modified Files
--------------
src/backend/catalog/dependency.c | 21 +++++++++++++++------
.../modules/test_pg_dump/expected/test_pg_dump.out | 7 +++++++
src/test/modules/test_pg_dump/sql/test_pg_dump.sql | 5 +++++
3 files changed, 27 insertions(+), 6 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Clean out column-level pg_init_privs entries when dropping table
In-Reply-To: <E1sIDPo-001WhL-V0@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox