https://www.postgresql.org/docs/current/static/textsearch-controls.html#textsearch-parsing-queries
Also, * can be attached to a lexeme to specify prefix matching:
https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES
while basic tsquery input takes the tokens at face value, to_tsquery
normalizes each token into a lexeme using the specified or default
configuration, and discards any tokens that are stop words according
to the configuration.
which leads me to a conclusion that your to_tsquery
throws a and I as stop words, staying with NO TEXT to query... (see the example with the rat and cat
in docs above)
(((Please dont ask what stop word is t)))
eg, if you (no to_tsquery
and thus stop words not thrown away)
with c(t) as (values('a an also at bond'),('but by illegal'),('I in it aligator'))
select t,to_tsvector(t) @@ ('a:*')::tsquery from c;
t | ?column?
-------------------+----------
a an also at bond | t
but by illegal | f
I in it aligator | t
(3 rows)
it will work...
for reference on stop words:
-bash-4.2$ grep "^t$" /usr/share/pgsql93/tsearch_data/english.stop
t
t is the one... but my modest knowledge of English lacks understanding why