Обсуждение: pgsql: Fix objectaddress.c code for publication relations.

Поиск
Список
Период
Сортировка

pgsql: Fix objectaddress.c code for publication relations.

От
Tom Lane
Дата:
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(-)