{
HeapTuple collTup;
Form_pg_collation coll;
+ char *nspname;
collTup = SearchSysCache1(COLLOID,
ObjectIdGetDatum(object->objectId));
elog(ERROR, "cache lookup failed for collation %u",
object->objectId);
coll = (Form_pg_collation) GETSTRUCT(collTup);
+
+ /* Qualify the name if not visible in search path */
+ if (CollationIsVisible(object->objectId))
+ nspname = NULL;
+ else
+ nspname = get_namespace_name(coll->collnamespace);
+
appendStringInfo(&buffer, _("collation %s"),
- NameStr(coll->collname));
+ quote_qualified_identifier(nspname,
+ NameStr(coll->collname)));
ReleaseSysCache(collTup);
break;
}
case OCLASS_CONVERSION:
{
HeapTuple conTup;
+ Form_pg_conversion conv;
+ char *nspname;
conTup = SearchSysCache1(CONVOID,
ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(conTup))
elog(ERROR, "cache lookup failed for conversion %u",
object->objectId);
+ conv = (Form_pg_conversion) GETSTRUCT(conTup);
+
+ /* Qualify the name if not visible in search path */
+ if (ConversionIsVisible(object->objectId))
+ nspname = NULL;
+ else
+ nspname = get_namespace_name(conv->connamespace);
+
appendStringInfo(&buffer, _("conversion %s"),
- NameStr(((Form_pg_conversion) GETSTRUCT(conTup))->conname));
+ quote_qualified_identifier(nspname,
+ NameStr(conv->conname)));
ReleaseSysCache(conTup);
break;
}
case OCLASS_TSPARSER:
{
HeapTuple tup;
+ Form_pg_ts_parser prsForm;
+ char *nspname;
tup = SearchSysCache1(TSPARSEROID,
ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search parser %u",
object->objectId);
+ prsForm = (Form_pg_ts_parser) GETSTRUCT(tup);
+
+ /* Qualify the name if not visible in search path */
+ if (TSParserIsVisible(object->objectId))
+ nspname = NULL;
+ else
+ nspname = get_namespace_name(prsForm->prsnamespace);
+
appendStringInfo(&buffer, _("text search parser %s"),
- NameStr(((Form_pg_ts_parser) GETSTRUCT(tup))->prsname));
+ quote_qualified_identifier(nspname,
+ NameStr(prsForm->prsname)));
ReleaseSysCache(tup);
break;
}
case OCLASS_TSDICT:
{
HeapTuple tup;
+ Form_pg_ts_dict dictForm;
+ char *nspname;
tup = SearchSysCache1(TSDICTOID,
ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search dictionary %u",
object->objectId);
+ dictForm = (Form_pg_ts_dict) GETSTRUCT(tup);
+
+ /* Qualify the name if not visible in search path */
+ if (TSDictionaryIsVisible(object->objectId))
+ nspname = NULL;
+ else
+ nspname = get_namespace_name(dictForm->dictnamespace);
+
appendStringInfo(&buffer, _("text search dictionary %s"),
- NameStr(((Form_pg_ts_dict) GETSTRUCT(tup))->dictname));
+ quote_qualified_identifier(nspname,
+ NameStr(dictForm->dictname)));
ReleaseSysCache(tup);
break;
}
case OCLASS_TSTEMPLATE:
{
HeapTuple tup;
+ Form_pg_ts_template tmplForm;
+ char *nspname;
tup = SearchSysCache1(TSTEMPLATEOID,
ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search template %u",
object->objectId);
+ tmplForm = (Form_pg_ts_template) GETSTRUCT(tup);
+
+ /* Qualify the name if not visible in search path */
+ if (TSTemplateIsVisible(object->objectId))
+ nspname = NULL;
+ else
+ nspname = get_namespace_name(tmplForm->tmplnamespace);
+
appendStringInfo(&buffer, _("text search template %s"),
- NameStr(((Form_pg_ts_template) GETSTRUCT(tup))->tmplname));
+ quote_qualified_identifier(nspname,
+ NameStr(tmplForm->tmplname)));
ReleaseSysCache(tup);
break;
}
case OCLASS_TSCONFIG:
{
HeapTuple tup;
+ Form_pg_ts_config cfgForm;
+ char *nspname;
tup = SearchSysCache1(TSCONFIGOID,
ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search configuration %u",
object->objectId);
+ cfgForm = (Form_pg_ts_config) GETSTRUCT(tup);
+
+ /* Qualify the name if not visible in search path */
+ if (TSConfigIsVisible(object->objectId))
+ nspname = NULL;
+ else
+ nspname = get_namespace_name(cfgForm->cfgnamespace);
+
appendStringInfo(&buffer, _("text search configuration %s"),
- NameStr(((Form_pg_ts_config) GETSTRUCT(tup))->cfgname));
+ quote_qualified_identifier(nspname,
+ NameStr(cfgForm->cfgname)));
ReleaseSysCache(tup);
break;
}
NOTICE: drop cascades to 9 other objects
DETAIL: drop cascades to function alt_nsp2.alt_func2(integer)
drop cascades to function alt_nsp2.alt_agg2(integer)
-drop cascades to conversion alt_conv2
+drop cascades to conversion alt_nsp2.alt_conv2
drop cascades to operator alt_nsp2.@-@(integer,integer)
drop cascades to operator family alt_nsp2.alt_opf2 for access method hash
-drop cascades to text search dictionary alt_ts_dict2
-drop cascades to text search configuration alt_ts_conf2
-drop cascades to text search template alt_ts_temp2
-drop cascades to text search parser alt_ts_prs2
+drop cascades to text search dictionary alt_nsp2.alt_ts_dict2
+drop cascades to text search configuration alt_nsp2.alt_ts_conf2
+drop cascades to text search template alt_nsp2.alt_ts_temp2
+drop cascades to text search parser alt_nsp2.alt_ts_prs2
DROP USER regtest_alter_user1;
DROP USER regtest_alter_user2;
DROP USER regtest_alter_user3;