pgsql: Properly schema-qualify additional object types in getObjectDesc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Properly schema-qualify additional object types in getObjectDesc
Date: 2018-05-24 16:08:04
Message-ID: E1fLsma-0007u2-9b@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Properly schema-qualify additional object types in getObjectDescription().

Collations, conversions, extended statistics objects (in >= v10),
and all four types of text search objects have schema-qualified names.
getObjectDescription() ignored that and would emit just the base name of
the object, potentially producing wrong or at least highly misleading
output. Fix it to add the schema name whenever the object is not "visible"
in the current search path, as is the rule for other schema-qualifiable
object types.

Although in common situations the output won't change, this seems to me
(tgl) to be a bug worthy of back-patching, hence do so.

Kyotaro Horiguchi, per a complaint from me

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

Branch
------
REL9_5_STABLE

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

Modified Files
--------------
src/backend/catalog/objectaddress.c | 76 ++++++++++++++++++++++++++---
src/test/regress/expected/alter_generic.out | 10 ++--
src/test/regress/expected/alter_table.out | 10 ++--
3 files changed, 80 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-05-24 16:39:02 pgsql: Fix objectaddress.c code for publication relations.
Previous Message Andrew Dunstan 2018-05-24 14:22:30 pgsql: Preserve information on use of git-external-diff