Skip to content

Commit 0d90679

Browse files
committed
Fix object identities for pg_conversion objects
We were neglecting to schema-qualify them. Backpatch to 9.3, where object identities were introduced as a concept by commit f8348ea.
1 parent 297b2c1 commit 0d90679

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/backend/catalog/objectaddress.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3415,17 +3415,21 @@ getObjectIdentityParts(const ObjectAddress *object,
34153415
{
34163416
HeapTuple conTup;
34173417
Form_pg_conversion conForm;
3418+
char *schema;
34183419

34193420
conTup = SearchSysCache1(CONVOID,
34203421
ObjectIdGetDatum(object->objectId));
34213422
if (!HeapTupleIsValid(conTup))
34223423
elog(ERROR, "cache lookup failed for conversion %u",
34233424
object->objectId);
34243425
conForm = (Form_pg_conversion) GETSTRUCT(conTup);
3426+
schema = get_namespace_name(conForm->connamespace);
34253427
appendStringInfoString(&buffer,
3426-
quote_identifier(NameStr(conForm->conname)));
3428+
quote_qualified_identifier(schema,
3429+
NameStr(conForm->conname)));
34273430
if (objname)
34283431
*objname = list_make1(pstrdup(NameStr(conForm->conname)));
3432+
pfree(schema);
34293433
ReleaseSysCache(conTup);
34303434
break;
34313435
}

src/test/regress/expected/object_address.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ SELECT (pg_identify_object(addr1.classid, addr1.objid, addr1.subobjid)).*,
370370
cast | | | (bigint AS integer) | t
371371
table constraint | addr_nsp | | a_chk on addr_nsp.gentable | t
372372
domain constraint | addr_nsp | | domconstr on addr_nsp.gendomain | t
373-
conversion | pg_catalog | ascii_to_mic | ascii_to_mic | t
373+
conversion | pg_catalog | ascii_to_mic | pg_catalog.ascii_to_mic | t
374374
language | | plpgsql | plpgsql | t
375375
schema | | addr_nsp | addr_nsp | t
376376
operator class | pg_catalog | int4_ops | pg_catalog.int4_ops for btree | t

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy