to_tsquery - Does it always accept quert text? I am very new to FTS features in Postgres, in fact, have started exploring them since yesterday only.
I wanted to pass list of values stored in columns of a DB tables instead of query text in to_tsquery.
Something like this:
select  * 
from t1
 where to_tsvector(&quot;col1&quot;) @@ to_tsquery((select col2 from t2 where id = 123))

Not sure if this is a possibility? Is there any alternative by which such kind of implementation can be achieved using to_tsquery?
If the values can be arbitrary strings, you can get errors:
SELECT to_tsquery('a&amp;');
ERROR:  no operand in tsquery: &quot;a&amp;&quot;
SELECT to_tsquery('''q');
ERROR:  syntax error in tsquery: &quot;'q&quot;

Use plainto_tsquery, which is designed to accept plain text strings.