pgsql: Fix objectaddress.c code for publication relations.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix objectaddress.c code for publication relations.
Date: 2018-05-24 16:39:02
Message-ID: E1fLtGY-0008VB-Vj@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix objectaddress.c code for publication relations.

getObjectDescription and getObjectIdentity failed to schema-qualify
the name of the published table, which is bad in getObjectDescription and
unforgivable in getObjectIdentity. Actually, getObjectIdentity failed to
emit the table's name at all unless "objname" output is requested, which
accidentally works for some (all?) extant callers but is clearly not the
intended API. Somebody had also not gotten the memo that the output of
getObjectIdentity is not to be translated.

To fix getObjectDescription, I made it call getRelationDescription, which
required refactoring the translatable string for the case, but is more
future-proof in case we ever publish relations that aren't plain tables.
While at it, I made the English output look like "publication of table X
in publication Y"; the added "of" seems to me to make it read much better.

Back-patch to v10 where publications were introduced.

Discussion: https://postgr.es/m/20180522.182020.114074746.horiguchi.kyotaro@lab.ntt.co.jp

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e8cb8fdfd3a219bbc01e80054d58bf6cbce745ef

Modified Files
--------------
src/backend/catalog/objectaddress.c | 21 +++++++++++++--------
src/test/regress/expected/object_address.out | 2 +-
2 files changed, 14 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-05-24 17:20:23 pgsql: Improve translatability of some getObjectDescription() messages.
Previous Message Tom Lane 2018-05-24 16:08:04 pgsql: Properly schema-qualify additional object types in getObjectDesc