How do you espace special characters in string passed to to_tsquery? For instance, this kind of query:
to_tsquery
select to_tsquery(\'AT&T\');
A simple solution is to create the tsquery as follows:
select $$'AT&T'$$::tsquery;
You can make more complex queries:
select $$'AT&T' & Phone | '|Bang!'$$::tsquery;
See the text search docs for more.