设置pg_trgm的默认限制 [英] Set default limit for pg_trgm
问题描述
这似乎是一个非常基本的问题,但是如何更改pg_trgm扩展的默认限制?目前是0.3。我已经完成:
select set_limit(0.5)
select show_limit()=> 0.5
关闭连接,重新连接:
select show_limit()=> 0.3
感谢您的帮助。
这可能不是解决方案,而是对潜在解决方案的贡献......
(我假设你想要所有连接到数据库的pg_trgm参数,而不仅仅是交互式的)
似乎默认的0.3限制是在函数中硬编码的:
trgm_op.c:
PG_MODULE_MAGIC;
float4 trgm_limit = 0.3f;
我不确定它是否可以通过任何配置文件进行控制,因此可以更改一个选项源文件中的默认值,并重新生成扩展名。
This seems like a really basic question, but how do I change the default limit for the pg_trgm extension? Which is currently 0.3. I have done:
select set_limit(0.5)
select show_limit() => 0.5
Close the connection, reconnect:
select show_limit() => 0.3
Thanks for your help.
This is probably not a solution, but rather a contribution to a potential solution...
(I am assuming that you want the pg_trgm parameter for all connections to the DB, not just interactive ones?)
It seems that the default 0.3 limit is hard coded in the function:
trgm_op.c:
PG_MODULE_MAGIC;
float4 trgm_limit = 0.3f;
I am not sure if it can be controlled through any configuration files, so one option could be to change the default in the source file, and re-build the extensions.
这篇关于设置pg_trgm的默认限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!