Re: [HACKERS] tsearch2 error msg

2006-10-04 Thread Markus Schaber
Hi, Tom, Tom Lane wrote: No, it should be something like syntax error in tsearch query: contents of string since it's not always the case that you know exactly what string got fed to to_tsquery(). I agree. It's also possible that you have more than one tsearch expression in the

[HACKERS] tsearch2 error msg

2006-10-03 Thread Magnus Hagander
search=# select to_tsquery('foo bar'); ERROR: syntax error Might want to enhance that message to include the information that it's parsing the tsquery that's failing? I originally had it as part of a much larger query, and it took me a while to remember that it's tsearch that spits out that

Re: [HACKERS] tsearch2 error msg

2006-10-03 Thread Teodor Sigaev
Might want to enhance that message to include the information that it's parsing the tsquery that's failing? I originally had it as part of a much larger query, and it took me a while to remember that it's tsearch that spits out that very generic error message. It possible, but not for 8.2 :(

Re: [HACKERS] tsearch2 error msg

2006-10-03 Thread Magnus Hagander
Might want to enhance that message to include the information that it's parsing the tsquery that's failing? I originally had it as part of a much larger query, and it took me a while to remember that it's tsearch that spits out that very generic error message. It possible, but not for

Re: [HACKERS] tsearch2 error msg

2006-10-03 Thread AgentM
On Oct 3, 2006, at 10:49 , Oleg Bartunov wrote: On Tue, 3 Oct 2006, Magnus Hagander wrote: BTW, try # select plainto_tsquery('foo bar'); plainto_tsquery - 'foo' 'bar' (1 row) It parses plain text and makes tsquery. Function exists only in 8.2 - some later we add docs

Re: [HACKERS] tsearch2 error msg

2006-10-03 Thread Teodor Sigaev
This is great news- previously, I was using various regexes to sanitize input into user-accessible search fields. Would it be build in some simple query language? sam AND spade blue OR yellow (same AND spade) OR (blue AND yellow) That's exactly to_tsquery syntax, just change AND to and OR

Re: [HACKERS] tsearch2 error msg

2006-10-03 Thread Martijn van Oosterhout
On Tue, Oct 03, 2006 at 04:34:06PM +0200, Magnus Hagander wrote: search=# select to_tsquery('foo bar'); ERROR: syntax error Seems to me, at the very least, the message should be: ERROR: tsearch: syntax error Then people have an idea where it comes from. Have a nice day, -- Martijn van

Re: [HACKERS] tsearch2 error msg

2006-10-03 Thread Tom Lane
Martijn van Oosterhout kleptog@svana.org writes: On Tue, Oct 03, 2006 at 04:34:06PM +0200, Magnus Hagander wrote: search=3D# select to_tsquery('foo bar'); ERROR: syntax error Seems to me, at the very least, the message should be: ERROR: tsearch: syntax error No, it should be something like