Commit 83ab8e32 authored by Alvaro Herrera's avatar Alvaro Herrera

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 f8348ea3.
parent 5b68d816
...@@ -3078,6 +3078,7 @@ getObjectIdentity(const ObjectAddress *object) ...@@ -3078,6 +3078,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));
...@@ -3085,8 +3086,10 @@ getObjectIdentity(const ObjectAddress *object) ...@@ -3085,8 +3086,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);
schema = get_namespace_name(formParser->prsnamespace);
appendStringInfoString(&buffer, appendStringInfoString(&buffer,
quote_identifier(NameStr(formParser->prsname))); quote_qualified_identifier(schema,
NameStr(formParser->prsname)));
ReleaseSysCache(tup); ReleaseSysCache(tup);
break; break;
} }
...@@ -3095,6 +3098,7 @@ getObjectIdentity(const ObjectAddress *object) ...@@ -3095,6 +3098,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));
...@@ -3102,8 +3106,10 @@ getObjectIdentity(const ObjectAddress *object) ...@@ -3102,8 +3106,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);
schema = get_namespace_name(formDict->dictnamespace);
appendStringInfoString(&buffer, appendStringInfoString(&buffer,
quote_identifier(NameStr(formDict->dictname))); quote_qualified_identifier(schema,
NameStr(formDict->dictname)));
ReleaseSysCache(tup); ReleaseSysCache(tup);
break; break;
} }
...@@ -3112,6 +3118,7 @@ getObjectIdentity(const ObjectAddress *object) ...@@ -3112,6 +3118,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));
...@@ -3119,8 +3126,11 @@ getObjectIdentity(const ObjectAddress *object) ...@@ -3119,8 +3126,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);
schema = get_namespace_name(formTmpl->tmplnamespace);
appendStringInfoString(&buffer, appendStringInfoString(&buffer,
quote_identifier(NameStr(formTmpl->tmplname))); quote_qualified_identifier(schema,
NameStr(formTmpl->tmplname)));
pfree(schema);
ReleaseSysCache(tup); ReleaseSysCache(tup);
break; break;
} }
...@@ -3129,6 +3139,7 @@ getObjectIdentity(const ObjectAddress *object) ...@@ -3129,6 +3139,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));
...@@ -3136,8 +3147,10 @@ getObjectIdentity(const ObjectAddress *object) ...@@ -3136,8 +3147,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);
schema = get_namespace_name(formCfg->cfgnamespace);
appendStringInfoString(&buffer, appendStringInfoString(&buffer,
quote_identifier(NameStr(formCfg->cfgname))); quote_qualified_identifier(schema,
NameStr(formCfg->cfgname)));
ReleaseSysCache(tup); ReleaseSysCache(tup);
break; break;
} }
......
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