1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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 f8348ea32e.
This commit is contained in:
Alvaro Herrera
2015-02-18 14:28:12 -03:00
parent a75dfb73e1
commit 66463a3cf1

View File

@ -2808,6 +2808,7 @@ getObjectIdentity(const ObjectAddress *object)
{ {
HeapTuple conTup; HeapTuple conTup;
Form_pg_conversion conForm; Form_pg_conversion conForm;
char *schema;
conTup = SearchSysCache1(CONVOID, conTup = SearchSysCache1(CONVOID,
ObjectIdGetDatum(object->objectId)); ObjectIdGetDatum(object->objectId));
@ -2815,8 +2816,11 @@ getObjectIdentity(const ObjectAddress *object)
elog(ERROR, "cache lookup failed for conversion %u", elog(ERROR, "cache lookup failed for conversion %u",
object->objectId); object->objectId);
conForm = (Form_pg_conversion) GETSTRUCT(conTup); conForm = (Form_pg_conversion) GETSTRUCT(conTup);
schema = get_namespace_name(conForm->connamespace);
appendStringInfoString(&buffer, appendStringInfoString(&buffer,
quote_identifier(NameStr(conForm->conname))); quote_qualified_identifier(schema,
NameStr(conForm->conname)));
pfree(schema);
ReleaseSysCache(conTup); ReleaseSysCache(conTup);
break; break;
} }