Distinguish publication exclusions in object addresses.

A pg_publication_rel entry can represent either an explicitly published
relation or a table excluded from a FOR ALL TABLES publication, but the
object address code treated every entry as a published relation without
checking prexcept. EXCEPT entries thus appeared as ordinary
published-table mappings in dependency messages, pg_identify_object(),
and pg_identify_object_as_address().

Report such entries as "publication excluded relation" instead, with
object identities indicating that the table is excluded from the
publication. pg_get_object_address() also accepts this new object type,
so that the output of pg_identify_object_as_address() can still be
passed back to it to look up the same object. "publication relation"
now resolves only non-EXCEPT entries, and "publication excluded
relation" only EXCEPT entries.

Oversight in commit fd366065e06.

Author: Fujii Masao <[email protected]>
Author: Vignesh C <[email protected]>
Reviewed-by: shveta malik <[email protected]>
Reviewed-by: Peter Smith <[email protected]>
Reviewed-by: Zhijie Hou <[email protected]>
Reviewed-by: Nisha Moond <[email protected]>
Reviewed-by: Amit Kapila <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Manuel Reyes Bravo <[email protected]>
Discussion: 
https://postgr.es/m/CAHGQGwHfESBexa7fq99EvFCf31av=o9h9udnw22ymxmm6lm...@mail.gmail.com
Backpatch-through: 19, where it was introduced

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/94670ba6d560b0738992b9bb7d0313d7d90af1d1

Modified Files
--------------
src/backend/catalog/aclchk.c                 |   2 +
src/backend/catalog/objectaddress.c          | 141 +++++++++++++++++++++++----
src/backend/commands/dropcmds.c              |   1 +
src/backend/commands/event_trigger.c         |   2 +
src/backend/commands/seclabel.c              |   1 +
src/include/nodes/parsenodes.h               |   1 +
src/test/regress/expected/object_address.out |  26 ++++-
src/test/regress/expected/publication.out    |  35 +++++++
src/test/regress/sql/object_address.sql      |  20 +++-
src/test/regress/sql/publication.sql         |  29 ++++++
10 files changed, 235 insertions(+), 23 deletions(-)

Reply via email to