Re: default_text_search_config and expression indexes - Mailing list pgsql-hackers
From | Bruce Momjian |
---|---|
Subject | Re: default_text_search_config and expression indexes |
Date | |
Msg-id | 200707311838.l6VIcXR03619@momjian.us Whole thread Raw |
In response to | Re: default_text_search_config and expression indexes (Oleg Bartunov <oleg@sai.msu.su>) |
Responses |
Re: default_text_search_config and expression indexes
|
List | pgsql-hackers |
Oleg Bartunov wrote: > >> If we remove default_text_search_config, it would also make ::tsvector > >> casting useless as well. > > > > OK, I just found a case that I think is going to make #3 a requirement > > (remove default_text_search_config). > > > > How is a CREATE INDEX ... to_tsvector(col) going to restore from a > > pg_dump? I see no way of guaranteeing that the > > default_text_search_config is correct on the restore, and in fact I > > don't think we have any way of knowing the default_text_search_config > > used for the index. > > > > And if we have to require the configuration name in CREATE INDEX, it has > > to be used in WHERE, so we might as well just remove the default > > capability and always require the configuration name. > > this is very rare use case for text searching > 1. expression index without configuration name > 2. default_text_search_config can be changed by somebody If you are going to be using the configuration name with the create expression index, you have to use it in the WHERE clause (or the index doesn't work), and I assume that is 90% of the text search uses. I don't see it as rare at all. > If somebody really need it, then he should be adviced to use configuration > name, else we don't guarantee that somebody could change > default_text_search_config variable and this could lead to > incorrect dump/restore. > > I don't think we should remove default_text_search_config because of > this rare case. I still feel the default_text_search_config has to be removed. We have tried all sorts of ways to make it work but having it not be 100% reliable for pg_dump/restore means it might as well be in /contrib and unsupported. If we have it in core, it has to work 100%. We can't have tons of examples that don't specify the configuration name and then expect every create expression index and WHERE clause to use it. default_text_search_config _can_ work, but it seems so easy to break and so easy to get wrong that I think it must be removed. If we are going to keep it, I need someone to explain why my comments above are wrong. If I am right, someone has to remove default_text_search_config from the patch. I can do the documentation. > Bruce, I'm in the mountains the Northern Caucasia and internet is > a bit unreliable :( Thanks. I noticed a lag in your reply. Hope you are having a good time. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +
pgsql-hackers by date: