The ftq() stored procedure is responsible for turning arbitrary input and our AND, OR, NOT boolean operations into a valid tsearch2 query string. It is failing in this case by leaving in the spurious punctuation; the '!' is a tsearch2 NOT operator and not proceded by an & or | to separate it, so we get a syntax error.
Its not an attack vector.
The ftq() stored procedure is responsible for turning arbitrary input and our AND, OR, NOT boolean operations into a valid tsearch2 query string. It is failing in this case by leaving in the spurious punctuation; the '!' is a tsearch2 NOT operator and not proceded by an & or | to separate it, so we get a syntax error.