在Heroku Postgres上,如何更改全文搜索字典?
我想更改我的“ Hobby Basic Heroku Postgres”数据库的default_text_search_config 。运行
HEROKU PG:PSQL
和 \ df
,
我可以看到Heroku有一个我想要的预设停止词典-Russian(PG_CATALOG.RUSSIAN
),因此无需创建一个新的词典(尽管我也看到了许多问题)。
根据 postgres docs ,可以通过改变<<<<<<<代码> postgresql.conf ,在这种情况下不适用,也不适用于单个会话。我已经尝试使用
设置Default_text_search_config ='PG_CATALOG.URSIAN';
,
但是,一旦我退出CLI,它将恢复为初始pg_catalog.english.english.english >。
我正在使用Prisma,所以我也尝试应用了此迁移的迁移,认为问题是在我关闭CLI之后不会持续存在的问题。这也不成功。
有办法这样做吗?
I'm wanting to change the default_text_search_config
of my "Hobby Basic Heroku Postgres" database. After running
heroku pg:psql
and\dF
,
I can see that Heroku has a preset stop dictionary that I want - Russian (pg_catalog.russian
), so there is no need to create a new dictionary (although I see many questions about this as well).
According to the postgres docs, one can change this by altering the postgresql.conf
, which is not applicable in this case, or by setting it for an individual session. I've tried setting it through the CLI with
SET default_text_search_config = 'pg_catalog.russian';
However, as soon as I exit the CLI, it reverts to the initial pg_catalog.english
.
I'm using Prisma, so I've tried applying a migration of this as well, thinking that the issue was the session not persisting after I closed the CLI. This also was not successful.
Is there a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也可以在数据库级别上设置默认值:
假设您的数据库称为
abcdefg
,请尝试以下操作:我怀疑这将在Heroku的产品中起作用,但没有尝试过。
It is also possible to set the default at the database level:
Assuming your database is called
abcdefg
, try the following:I suspect this will work on Heroku's offering, but have not tried it.