Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Oleg Bartunov
On Tue, 14 Aug 2007, Alvaro Herrera wrote: Oleg Bartunov wrote: On Tue, 14 Aug 2007, Alvaro Herrera wrote: Oleg Bartunov wrote: On Thu, 9 Aug 2007, [EMAIL PROTECTED] wrote: Maybe I'm missing something, but it seems to me that the configuration is more attached to a column/index thatn to th

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Mike Rylander
On 8/14/07, Gregory Stark <[EMAIL PROTECTED]> wrote: > "Mike Rylander" <[EMAIL PROTECTED]> writes: > > > My application (http://open-ils.org, which run >80% of the public > > libraries in Georgia, USA, http://gapines.org and > > http://georgialibraries.org/lib/pines.html) requires that I be able to

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Bruce Momjian
Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > Bruce Momjian escribi?: > >> What has really hurt the default GUC idea is how to do restores from a > >> pg_dump. > > > I guess what should happen is that pg_dump should include a > > SET default_text_search_config = 'foo' > > just b

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Gregory Stark
"Mike Rylander" <[EMAIL PROTECTED]> writes: > My application (http://open-ils.org, which run >80% of the public > libraries in Georgia, USA, http://gapines.org and > http://georgialibraries.org/lib/pines.html) requires that I be able to > search a corpus of bibliographic records in a mix of langua

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Bruce Momjian escribió: >> What has really hurt the default GUC idea is how to do restores from a >> pg_dump. > I guess what should happen is that pg_dump should include a > SET default_text_search_config = 'foo' > just before the CREATE INDEX, like we

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Mike Rylander
On 8/14/07, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Oleg Bartunov wrote: > > On Tue, 14 Aug 2007, Alvaro Herrera wrote: > > > >> Oleg Bartunov wrote: > >>> On Thu, 9 Aug 2007, [EMAIL PROTECTED] wrote: > >>> > Maybe I'm missing something, but it seems to me that the configuration > is

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Alvaro Herrera
Oleg Bartunov wrote: > On Tue, 14 Aug 2007, Alvaro Herrera wrote: > >> Oleg Bartunov wrote: >>> On Thu, 9 Aug 2007, [EMAIL PROTECTED] wrote: >>> Maybe I'm missing something, but it seems to me that the configuration is more attached to a column/index thatn to the whole database. If t

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Alvaro Herrera
Bruce Momjian escribió: > Mike Rylander wrote: > > This is just my $0.02 as a fairly heavy user of the current tsearch2 > > code, but I sincerely hope you do not cripple the system by removing > > the ability to store tsvectors built using arbitrary configurations in > > a single column. Yes, it c

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Bruce Momjian
Mike Rylander wrote: > This is just my $0.02 as a fairly heavy user of the current tsearch2 > code, but I sincerely hope you do not cripple the system by removing > the ability to store tsvectors built using arbitrary configurations in > a single column. Yes, it can lead to unexpected results if y

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Bruce Momjian
Heikki Linnakangas wrote: > Bruce Momjian wrote: > > Heikki Linnakangas wrote: > >> Bruce Momjian wrote: > >>> Heikki Linnakangas wrote: > Removing the default configuration setting altogether removes the 2nd > problem, but that's not good from a usability point of view. And it > doe

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Mike Rylander
On 8/14/07, Heikki Linnakangas <[EMAIL PROTECTED]> wrote: > Mike Rylander wrote: [snip] > > Don't you need to use the right configuration to parse the query into a > tsquery as well? > Only if the user (or user agent) can supply enough information to move away from the configured default of, say,

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Oleg Bartunov
On Tue, 14 Aug 2007, Alvaro Herrera wrote: Oleg Bartunov wrote: On Thu, 9 Aug 2007, [EMAIL PROTECTED] wrote: Maybe I'm missing something, but it seems to me that the configuration is more attached to a column/index thatn to the whole database. If there's a default in an expression, I'd rather

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Heikki Linnakangas
Bruce Momjian wrote: > Heikki Linnakangas wrote: >> Bruce Momjian wrote: >>> Heikki Linnakangas wrote: Removing the default configuration setting altogether removes the 2nd problem, but that's not good from a usability point of view. And it doesn't solve the general issue, you can st

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Heikki Linnakangas
Mike Rylander wrote: > This is just my $0.02 as a fairly heavy user of the current tsearch2 > code, but I sincerely hope you do not cripple the system by removing > the ability to store tsvectors built using arbitrary configurations in > a single column. Yes, it can lead to unexpected results if y

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Mike Rylander
On 8/13/07, Bruce Momjian <[EMAIL PROTECTED]> wrote: > Heikki Linnakangas wrote: > > Bruce Momjian wrote: > > > Heikki Linnakangas wrote: > > >> Removing the default configuration setting altogether removes the 2nd > > >> problem, but that's not good from a usability point of view. And it > > >> do

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Gregory Stark
"Alvaro Herrera" <[EMAIL PROTECTED]> writes: > Oleg Bartunov wrote: >> >> I'm tired to repeat - index itself doesn't know about configuration ! > > Is there a way to change that? For example store the configuration in a > metapage or something? I think Heikki's suggestion of having each configu

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-14 Thread Alvaro Herrera
Oleg Bartunov wrote: > On Thu, 9 Aug 2007, [EMAIL PROTECTED] wrote: > >> Maybe I'm missing something, but it seems to me that the configuration >> is more attached to a column/index thatn to the whole database. If >> there's a default in an expression, I'd rather expect this default to be >> drawn

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-13 Thread Bruce Momjian
Heikki Linnakangas wrote: > Bruce Momjian wrote: > > Heikki Linnakangas wrote: > >> Removing the default configuration setting altogether removes the 2nd > >> problem, but that's not good from a usability point of view. And it > >> doesn't solve the general issue, you can still do things like: > >>

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-13 Thread Bruce Momjian
Heikki Linnakangas wrote: > Oleg Bartunov wrote: > > On Wed, 8 Aug 2007, Bruce Momjian wrote: > >> Heikki Linnakangas wrote: > >>> If I understood correctly, the basic issue is that a tsvector datum > >>> created using configuration A is incompatible with a tsquery datum > >>> created using configu

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-10 Thread Heikki Linnakangas
Bruce Momjian wrote: > Heikki Linnakangas wrote: >> Removing the default configuration setting altogether removes the 2nd >> problem, but that's not good from a usability point of view. And it >> doesn't solve the general issue, you can still do things like: >> SELECT * FROM foo WHERE to_tsvector('

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-10 Thread Heikki Linnakangas
Oleg Bartunov wrote: > On Wed, 8 Aug 2007, Bruce Momjian wrote: >> Heikki Linnakangas wrote: >>> If I understood correctly, the basic issue is that a tsvector datum >>> created using configuration A is incompatible with a tsquery datum >>> created using configuration B, in the sense that you won't

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-09 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Aug 09, 2007 at 02:03:13PM +0400, Oleg Bartunov wrote: > On Thu, 9 Aug 2007, [EMAIL PROTECTED] wrote: > > >Maybe I'm missing something [...] > I'm tired to repeat - index itself doesn't know about configuration ! > It just index tsvector data

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-09 Thread Oleg Bartunov
On Thu, 9 Aug 2007, [EMAIL PROTECTED] wrote: Maybe I'm missing something, but it seems to me that the configuration is more attached to a column/index thatn to the whole database. If there's a default in an expression, I'd rather expect this default to be drawn from the index involved than from

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-09 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Aug 09, 2007 at 02:36:41AM -0400, Bruce Momjian wrote: > Oleg Bartunov wrote: > > > Yea, seems more work than is necessary. If we require the configuration > > > to be always supplied, and document that mismatches are a problem, I > > > think

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-08 Thread Bruce Momjian
Oleg Bartunov wrote: > > Yea, seems more work than is necessary. If we require the configuration > > to be always supplied, and document that mismatches are a problem, I > > think we are in good shape. > > We should agree that all you describe is only for DUMMY users. > >From authors point of vi

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-08 Thread Oleg Bartunov
On Wed, 8 Aug 2007, Bruce Momjian wrote: Heikki Linnakangas wrote: Sure, but you have make sure you use the right configuration in the trigger, no? Does the tsquery have to use the same configuration? I wish I knew this myself. :-) Whatever I had done happened to work but that was largely t

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-08 Thread Bruce Momjian
Heikki Linnakangas wrote: > >>> Sure, but you have make sure you use the right configuration in the > >>> trigger, no? Does the tsquery have to use the same configuration? > >> I wish I knew this myself. :-) Whatever I had done happened to work > >> but that was largely through people on IRC wal

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-05 Thread Heikki Linnakangas
Bruce Momjian wrote: > Ron Mayer wrote: >> We need more feedback from users. > Well, I am waiting for other hackers to get involved, but if they don't, > I have to evaluate it myself on the email lists. Personally, I think documentation changes would be an OK way to to handle

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-01 Thread Ron Mayer
Bruce Momjian wrote: > Ron Mayer wrote: >> I wish I knew this myself. :-) Whatever I had done happened to work >> but that was largely through people on IRC walking me through it. > > This illustrates the major issue --- that this has to be simple for > people to get started, while keeping the c

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-01 Thread Bruce Momjian
Ron Mayer wrote: > We need more feedback from users. > >>> Well, I am waiting for other hackers to get involved, but if they don't, > >>> I have to evaluate it myself on the email lists. > >> Personally, I think documentation changes would be an OK way to > >> to handle it. Something that ma

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-01 Thread Ron Mayer
Bruce Momjian wrote: > Ron Mayer wrote: >> Bruce Momjian wrote: >>> Oleg Bartunov wrote: What is a basis of your assumption ? >> I think I asked about this kind of usage a couple years back;... >> >> http://archives.postgresql.org/pgsql-general/2005-10/msg00475.php >> http://archives.postgres

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-01 Thread Bruce Momjian
Ron Mayer wrote: > Bruce Momjian wrote: > > Oleg Bartunov wrote: > >> What is a basis of your assumption ? In my opinion, it's very limited > >> use of text search, because it doesn't supports ranking. For 4-5 years > >> of tsearch2 usage I never used it and I never seem in mailing lists. > >> This

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-01 Thread Bruce Momjian
Oleg Bartunov wrote: > On Tue, 31 Jul 2007, Bruce Momjian wrote: > > > Oleg Bartunov wrote: > >> On Tue, 31 Jul 2007, Bruce Momjian wrote: > >> > > 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

Re: [HACKERS] default_text_search_config and expression indexes

2007-08-01 Thread Ron Mayer
Bruce Momjian wrote: > Oleg Bartunov wrote: >> What is a basis of your assumption ? In my opinion, it's very limited >> use of text search, because it doesn't supports ranking. For 4-5 years >> of tsearch2 usage I never used it and I never seem in mailing lists. >> This is very user-oriented featur

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-31 Thread Oleg Bartunov
On Tue, 31 Jul 2007, Bruce Momjian wrote: Oleg Bartunov wrote: On Tue, 31 Jul 2007, Bruce Momjian wrote: 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 na

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-31 Thread Bruce Momjian
Oleg Bartunov wrote: > On Tue, 31 Jul 2007, Bruce Momjian wrote: > > >>> 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 ver

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-31 Thread Oleg Bartunov
On Tue, 31 Jul 2007, Bruce Momjian wrote: 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

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-31 Thread Bruce Momjian
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) g

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-31 Thread Oleg Bartunov
On Mon, 30 Jul 2007, Bruce Momjian wrote: Bruce Momjian wrote: We have to decide if we want a GUC default_text_search_config, and if so when can it be changed. Right now there are three ways to create a tsvector (or tsquery) ::tsvector to_tsvector(value) to_tsvector(co

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-31 Thread Oleg Bartunov
On Mon, 30 Jul 2007, Bruce Momjian wrote: Oleg Bartunov wrote: OK, here is what I am thinking. If we make default_text_search_config super-user-only, then the user can't do SET (using "zero_damaged_pages" as a superuser-only example): test=> set zero_damaged_pages = on; ERROR:

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-30 Thread Bruce Momjian
Alvaro Herrera wrote: > Bruce Momjian wrote: > > Bruce Momjian wrote: > > > > 3) Remove default_text_search_config and require the > > > configuration to be specified in each function call. > > > > > > If we remove default_text_search_config, it would also make ::tsvector > > > casting use

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-30 Thread Alvaro Herrera
Bruce Momjian wrote: > Bruce Momjian wrote: > > 3) Remove default_text_search_config and require the > >configuration to be specified in each function call. > > > > If we remove default_text_search_config, it would also make ::tsvector > > casting useless as well. > > OK, I just foun

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-30 Thread Bruce Momjian
Bruce Momjian wrote: > We have to decide if we want a GUC default_text_search_config, and if so > when can it be changed. > > Right now there are three ways to create a tsvector (or tsquery) > > ::tsvector > to_tsvector(value) > to_tsvector(config, value) > > (ignoring plainto_

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-30 Thread Bruce Momjian
Oleg Bartunov wrote: > > OK, here is what I am thinking. If we make default_text_search_config > > super-user-only, then the user can't do SET (using "zero_damaged_pages" > > as a superuser-only example): > > > > test=> set zero_damaged_pages = on; > > ERROR: permission denied to set para

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-28 Thread Oleg Bartunov
On Fri, 27 Jul 2007, Bruce Momjian wrote: Magnus Hagander wrote: However, the big problem is that the expressions used in expression indexes should not change their output based on the value of a GUC variable (because it would corrupt the index), but in the case above, default_text_search_confi

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-28 Thread Magnus Hagander
Bruce Momjian wrote: > Magnus Hagander wrote: >>> However, the big problem is that the expressions used in expression >>> indexes should not change their output based on the value of a GUC >>> variable (because it would corrupt the index), but in the case above, >>> default_text_search_config contr

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-27 Thread Bruce Momjian
Magnus Hagander wrote: > > However, the big problem is that the expressions used in expression > > indexes should not change their output based on the value of a GUC > > variable (because it would corrupt the index), but in the case above, > > default_text_search_config controls what configuration

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-27 Thread Magnus Hagander
On Thu, Jul 26, 2007 at 06:23:51PM -0400, Bruce Momjian wrote: > Oleg Bartunov wrote: > > >> Second, I can't figure out how to reference a non-default > > >> configuration. > > > > > > See the multi-argument versions of to_tsvector etc. > > > > > > I do see a problem with having to_tsvector(config,

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-27 Thread Pavel Stehule
> configuration has NOTHING with language ! This is a most frequent myth about > configuration. It's just the way we chose for default_text_search_config to > use language part of locale at initdb time. > text search configuration is just a bind between parser to use for > breaking document by lexe

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-27 Thread Oleg Bartunov
On Fri, 27 Jul 2007, Pavel Stehule wrote: 2007/7/27, Oleg Bartunov <[EMAIL PROTECTED]>: On Fri, 27 Jul 2007, Pavel Stehule wrote: 1) Document the problem and do nothing else. 2) Make default_text_search_config a postgresql.conf-only setting, thereby making it impos

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-27 Thread Pavel Stehule
2007/7/27, Oleg Bartunov <[EMAIL PROTECTED]>: > On Fri, 27 Jul 2007, Pavel Stehule wrote: > > >> > >> 1) Document the problem and do nothing else. > >> 2) Make default_text_search_config a postgresql.conf-only > >>setting, thereby making it impossible to change by non-su

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-26 Thread Oleg Bartunov
On Fri, 27 Jul 2007, Pavel Stehule wrote: 1) Document the problem and do nothing else. 2) Make default_text_search_config a postgresql.conf-only setting, thereby making it impossible to change by non-super users, or make it a super-user-only setting.

Re: [HACKERS] default_text_search_config and expression indexes

2007-07-26 Thread Pavel Stehule
> > 1) Document the problem and do nothing else. > 2) Make default_text_search_config a postgresql.conf-only >setting, thereby making it impossible to change by non-super >users, or make it a super-user-only setting. > 3) Remove default_text_search_co

[HACKERS] default_text_search_config and expression indexes

2007-07-26 Thread Bruce Momjian
Oleg Bartunov wrote: > >> Second, I can't figure out how to reference a non-default > >> configuration. > > > > See the multi-argument versions of to_tsvector etc. > > > > I do see a problem with having to_tsvector(config, text) plus > > to_tsvector(text) where the latter implicitly references a co