Clean out column-level pg_init_privs entries when dropping tables.
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/dependency.c | modified | +15 −6 |
| src/test/modules/test_pg_dump/expected/test_pg_dump.out | modified | +7 −0 |
| src/test/modules/test_pg_dump/sql/test_pg_dump.sql | modified | +5 −0 |