there are more problems with tsvectors. this also fails:

SELECT ' just a test: 123 '::tsvector;
ERROR:  syntax error in tsvector: " just a test: 123 "

That's not a bug; your input isn't valid tsvector syntax.


ok. after re-reading page

http://www.postgresql.org/docs/8.3/static/textsearch-intro.html#TEXTSEARCH-SEARCHES

i saw my mistake. i misinterpreted the examples to show the possibility to convert *any* text by using casting to tsvector as an alternative to using to_tsvector :)

to new tsearch-users, it might not be obvious clear that you can't just cast any text but should use to_tsvector. the example string 'a fat cat sat on a mat and ate a fat rat' looks like an normal "random" text string, especially when a tsvector in psql looks like

'ate':9 'cat':3 'fat':2,11 'mat':7 'rat':12 'sat':4

and doesn't contain stopwords like "a" and "and", which are included in the casted string...


maybe an additional example that shows the usage of to_tsvector for any input string would help...

thanks, thomas



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to