Postgres:两个同名的词典 [英] Postgres: two dictionaries with same name

查看:141
本文介绍了Postgres:两个同名的词典的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下查询创建了一个文本搜索字典。

I've created a text search dictionary using the following query.

CREATE TEXT SEARCH DICTIONARY english_stem 
(TEMPLATE = snowball, Language = english, StopWords = english);

但是我意识到已经有一个名称为english_stem的字典,该字典由超级用户拥有,我最后有两个同名的词典english_stem;一个由超级拥有,一个由我拥有。

But I realized that there was already a dictionary with same name 'english_stem' which is owned by superuser and I ended up having two dictionaries with same name 'english_stem'; one owned by super and one owned by me.

所以我试图删除我使用这个查询创建的一个:

So I tried to drop the one that I created using this query:

DROP TEXT SEARCH DICTIONARY english_stem;

但是我得到[42501]错误:必须是文本搜索字典english_stem的所有者信息。我猜拖放查询是试图删除超级用户拥有的english_stem字典,而不是我拥有的。如何删除我拥有的english_stem字典?

But I am getting "[42501] ERROR: must be owner of text search dictionary english_stem" message. I guess the drop query is trying to drop the english_stem dictionary owned by superuser, not owned by me. How can I drop the english_stem dictionary owned by me?

如果postgres允许使用同一个名字的多个字典,我想有一种方法来区分它们,当执行alter /下载命令。

If postgres allows multiple dictionaries with the same name, I guess there must be a way to differentiate them when executing alter/drop command on them.

顺便说一下,可能是由于我创建的,tsquery很慢;甚至比查询更慢。

By the way, probably due to the one created by me, tsquery is slow; even slower than like query.

注意:我正在寻找一种解决方法,而无需与超级用户联系。

Note: I am looking for a way to resolve this without contacting the super user.

推荐答案

我相信你在你的架构或公共场合创建了字典。查看:

I believe you created dictionary in your schema or in public. Check out:

SELECT * from  pg_catalog.pg_ts_dict 
JOIN pg_catalog.pg_namespace n ON n.oid = pg_ts_dict.dictnamespace;

如果是,只需添加模式名称,如:

If so, just add schema name, like:

DROP TEXT SEARCH DICTIONARY public.english_stem;

这篇关于Postgres:两个同名的词典的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆