Skip site navigation (1) Skip section navigation (2)

Re: default_text_search_config and expression indexes

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paesold <mpaesold(at)gmx(dot)at>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: default_text_search_config and expression indexes
Date: 2007-07-31 18:38:33
Message-ID: 200707311838.l6VIcXR03619@momjian.us (view raw or flat)
Thread:
Lists: pgsql-advocacypgsql-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(at)momjian(dot)us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-hackers by date

Next:From: Greg SmithDate: 2007-07-31 18:51:03
Subject: Re: Machine available for community use
Previous:From: Tom LaneDate: 2007-07-31 18:30:27
Subject: Re: stats_block_level

pgsql-advocacy by date

Next:From: David FetterDate: 2007-07-31 18:48:18
Subject: Re: postgresql publication ---> was "Re: NewMySQL Journal"
Previous:From: Oleg BartunovDate: 2007-07-31 18:28:26
Subject: Re: default_text_search_config and expression indexes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group