Commit 0d906798 authored by Alvaro Herrera's avatar Alvaro Herrera

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 f8348ea3.
parent 297b2c1e
......@@ -3415,6 +3415,7 @@ getObjectIdentityParts(const ObjectAddress *object,
{
HeapTuple conTup;
Form_pg_conversion conForm;
char *schema;
conTup = SearchSysCache1(CONVOID,
ObjectIdGetDatum(object->objectId));
......@@ -3422,10 +3423,13 @@ getObjectIdentityParts(const ObjectAddress *object,
elog(ERROR, "cache lookup failed for conversion %u",
object->objectId);
conForm = (Form_pg_conversion) GETSTRUCT(conTup);
schema = get_namespace_name(conForm->connamespace);
appendStringInfoString(&buffer,
quote_identifier(NameStr(conForm->conname)));
quote_qualified_identifier(schema,
NameStr(conForm->conname)));
if (objname)
*objname = list_make1(pstrdup(NameStr(conForm->conname)));
pfree(schema);
ReleaseSysCache(conTup);
break;
}
......
......@@ -370,7 +370,7 @@ SELECT (pg_identify_object(addr1.classid, addr1.objid, addr1.subobjid)).*,
cast | | | (bigint AS integer) | t
table constraint | addr_nsp | | a_chk on addr_nsp.gentable | t
domain constraint | addr_nsp | | domconstr on addr_nsp.gendomain | t
conversion | pg_catalog | ascii_to_mic | ascii_to_mic | t
conversion | pg_catalog | ascii_to_mic | pg_catalog.ascii_to_mic | t
language | | plpgsql | plpgsql | t
schema | | addr_nsp | addr_nsp | t
operator class | pg_catalog | int4_ops | pg_catalog.int4_ops for btree | t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment