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;
|
HeapTuple tup;
|
||||||
Form_pg_ts_parser formParser;
|
Form_pg_ts_parser formParser;
|
||||||
|
char *schema;
|
||||||
|
|
||||||
tup = SearchSysCache1(TSPARSEROID,
|
tup = SearchSysCache1(TSPARSEROID,
|
||||||
ObjectIdGetDatum(object->objectId));
|
ObjectIdGetDatum(object->objectId));
|
||||||
@ -3063,8 +3064,10 @@ getObjectIdentity(const ObjectAddress *object)
|
|||||||
elog(ERROR, "cache lookup failed for text search parser %u",
|
elog(ERROR, "cache lookup failed for text search parser %u",
|
||||||
object->objectId);
|
object->objectId);
|
||||||
formParser = (Form_pg_ts_parser) GETSTRUCT(tup);
|
formParser = (Form_pg_ts_parser) GETSTRUCT(tup);
|
||||||
appendStringInfo(&buffer, "%s",
|
schema = get_namespace_name(formParser->prsnamespace);
|
||||||
quote_identifier(NameStr(formParser->prsname)));
|
appendStringInfoString(&buffer,
|
||||||
|
quote_qualified_identifier(schema,
|
||||||
|
NameStr(formParser->prsname)));
|
||||||
ReleaseSysCache(tup);
|
ReleaseSysCache(tup);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3073,6 +3076,7 @@ getObjectIdentity(const ObjectAddress *object)
|
|||||||
{
|
{
|
||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
Form_pg_ts_dict formDict;
|
Form_pg_ts_dict formDict;
|
||||||
|
char *schema;
|
||||||
|
|
||||||
tup = SearchSysCache1(TSDICTOID,
|
tup = SearchSysCache1(TSDICTOID,
|
||||||
ObjectIdGetDatum(object->objectId));
|
ObjectIdGetDatum(object->objectId));
|
||||||
@ -3080,8 +3084,10 @@ getObjectIdentity(const ObjectAddress *object)
|
|||||||
elog(ERROR, "cache lookup failed for text search dictionary %u",
|
elog(ERROR, "cache lookup failed for text search dictionary %u",
|
||||||
object->objectId);
|
object->objectId);
|
||||||
formDict = (Form_pg_ts_dict) GETSTRUCT(tup);
|
formDict = (Form_pg_ts_dict) GETSTRUCT(tup);
|
||||||
appendStringInfo(&buffer, "%s",
|
schema = get_namespace_name(formDict->dictnamespace);
|
||||||
quote_identifier(NameStr(formDict->dictname)));
|
appendStringInfoString(&buffer,
|
||||||
|
quote_qualified_identifier(schema,
|
||||||
|
NameStr(formDict->dictname)));
|
||||||
ReleaseSysCache(tup);
|
ReleaseSysCache(tup);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3090,6 +3096,7 @@ getObjectIdentity(const ObjectAddress *object)
|
|||||||
{
|
{
|
||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
Form_pg_ts_template formTmpl;
|
Form_pg_ts_template formTmpl;
|
||||||
|
char *schema;
|
||||||
|
|
||||||
tup = SearchSysCache1(TSTEMPLATEOID,
|
tup = SearchSysCache1(TSTEMPLATEOID,
|
||||||
ObjectIdGetDatum(object->objectId));
|
ObjectIdGetDatum(object->objectId));
|
||||||
@ -3097,8 +3104,11 @@ getObjectIdentity(const ObjectAddress *object)
|
|||||||
elog(ERROR, "cache lookup failed for text search template %u",
|
elog(ERROR, "cache lookup failed for text search template %u",
|
||||||
object->objectId);
|
object->objectId);
|
||||||
formTmpl = (Form_pg_ts_template) GETSTRUCT(tup);
|
formTmpl = (Form_pg_ts_template) GETSTRUCT(tup);
|
||||||
appendStringInfo(&buffer, "%s",
|
schema = get_namespace_name(formTmpl->tmplnamespace);
|
||||||
quote_identifier(NameStr(formTmpl->tmplname)));
|
appendStringInfoString(&buffer,
|
||||||
|
quote_qualified_identifier(schema,
|
||||||
|
NameStr(formTmpl->tmplname)));
|
||||||
|
pfree(schema);
|
||||||
ReleaseSysCache(tup);
|
ReleaseSysCache(tup);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3107,6 +3117,7 @@ getObjectIdentity(const ObjectAddress *object)
|
|||||||
{
|
{
|
||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
Form_pg_ts_config formCfg;
|
Form_pg_ts_config formCfg;
|
||||||
|
char *schema;
|
||||||
|
|
||||||
tup = SearchSysCache1(TSCONFIGOID,
|
tup = SearchSysCache1(TSCONFIGOID,
|
||||||
ObjectIdGetDatum(object->objectId));
|
ObjectIdGetDatum(object->objectId));
|
||||||
@ -3114,8 +3125,10 @@ getObjectIdentity(const ObjectAddress *object)
|
|||||||
elog(ERROR, "cache lookup failed for text search configuration %u",
|
elog(ERROR, "cache lookup failed for text search configuration %u",
|
||||||
object->objectId);
|
object->objectId);
|
||||||
formCfg = (Form_pg_ts_config) GETSTRUCT(tup);
|
formCfg = (Form_pg_ts_config) GETSTRUCT(tup);
|
||||||
appendStringInfo(&buffer, "%s",
|
schema = get_namespace_name(formCfg->cfgnamespace);
|
||||||
quote_identifier(NameStr(formCfg->cfgname)));
|
appendStringInfoString(&buffer,
|
||||||
|
quote_qualified_identifier(schema,
|
||||||
|
NameStr(formCfg->cfgname)));
|
||||||
ReleaseSysCache(tup);
|
ReleaseSysCache(tup);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user