Fix object identities for text search objects
We were neglecting to schema-qualify them. Backpatch to 9.3, where object identities were introduced as a concept by commit f8348ea32ec8.
This commit is contained in:
parent
9612b982b8
commit
0bf52bd990
@ -3056,6 +3056,7 @@ getObjectIdentity(const ObjectAddress *object)
|
||||
{
|
||||
HeapTuple tup;
|
||||
Form_pg_ts_parser formParser;
|
||||
char *schema;
|
||||
|
||||
tup = SearchSysCache1(TSPARSEROID,
|
||||
ObjectIdGetDatum(object->objectId));
|
||||
@ -3063,8 +3064,10 @@ getObjectIdentity(const ObjectAddress *object)
|
||||
elog(ERROR, "cache lookup failed for text search parser %u",
|
||||
object->objectId);
|
||||
formParser = (Form_pg_ts_parser) GETSTRUCT(tup);
|
||||
appendStringInfo(&buffer, "%s",
|
||||
quote_identifier(NameStr(formParser->prsname)));
|
||||
schema = get_namespace_name(formParser->prsnamespace);
|
||||
appendStringInfoString(&buffer,
|
||||
quote_qualified_identifier(schema,
|
||||
NameStr(formParser->prsname)));
|
||||
ReleaseSysCache(tup);
|
||||
break;
|
||||
}
|
||||
@ -3073,6 +3076,7 @@ getObjectIdentity(const ObjectAddress *object)
|
||||
{
|
||||
HeapTuple tup;
|
||||
Form_pg_ts_dict formDict;
|
||||
char *schema;
|
||||
|
||||
tup = SearchSysCache1(TSDICTOID,
|
||||
ObjectIdGetDatum(object->objectId));
|
||||
@ -3080,8 +3084,10 @@ getObjectIdentity(const ObjectAddress *object)
|
||||
elog(ERROR, "cache lookup failed for text search dictionary %u",
|
||||
object->objectId);
|
||||
formDict = (Form_pg_ts_dict) GETSTRUCT(tup);
|
||||
appendStringInfo(&buffer, "%s",
|
||||
quote_identifier(NameStr(formDict->dictname)));
|
||||
schema = get_namespace_name(formDict->dictnamespace);
|
||||
appendStringInfoString(&buffer,
|
||||
quote_qualified_identifier(schema,
|
||||
NameStr(formDict->dictname)));
|
||||
ReleaseSysCache(tup);
|
||||
break;
|
||||
}
|
||||
@ -3090,6 +3096,7 @@ getObjectIdentity(const ObjectAddress *object)
|
||||
{
|
||||
HeapTuple tup;
|
||||
Form_pg_ts_template formTmpl;
|
||||
char *schema;
|
||||
|
||||
tup = SearchSysCache1(TSTEMPLATEOID,
|
||||
ObjectIdGetDatum(object->objectId));
|
||||
@ -3097,8 +3104,11 @@ getObjectIdentity(const ObjectAddress *object)
|
||||
elog(ERROR, "cache lookup failed for text search template %u",
|
||||
object->objectId);
|
||||
formTmpl = (Form_pg_ts_template) GETSTRUCT(tup);
|
||||
appendStringInfo(&buffer, "%s",
|
||||
quote_identifier(NameStr(formTmpl->tmplname)));
|
||||
schema = get_namespace_name(formTmpl->tmplnamespace);
|
||||
appendStringInfoString(&buffer,
|
||||
quote_qualified_identifier(schema,
|
||||
NameStr(formTmpl->tmplname)));
|
||||
pfree(schema);
|
||||
ReleaseSysCache(tup);
|
||||
break;
|
||||
}
|
||||
@ -3107,6 +3117,7 @@ getObjectIdentity(const ObjectAddress *object)
|
||||
{
|
||||
HeapTuple tup;
|
||||
Form_pg_ts_config formCfg;
|
||||
char *schema;
|
||||
|
||||
tup = SearchSysCache1(TSCONFIGOID,
|
||||
ObjectIdGetDatum(object->objectId));
|
||||
@ -3114,8 +3125,10 @@ getObjectIdentity(const ObjectAddress *object)
|
||||
elog(ERROR, "cache lookup failed for text search configuration %u",
|
||||
object->objectId);
|
||||
formCfg = (Form_pg_ts_config) GETSTRUCT(tup);
|
||||
appendStringInfo(&buffer, "%s",
|
||||
quote_identifier(NameStr(formCfg->cfgname)));
|
||||
schema = get_namespace_name(formCfg->cfgnamespace);
|
||||
appendStringInfoString(&buffer,
|
||||
quote_qualified_identifier(schema,
|
||||
NameStr(formCfg->cfgname)));
|
||||
ReleaseSysCache(tup);
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user