Rafia Sabih <rafia.pghackers@gmail.com> writes:
> Thank you for reporting this. However I found that the lack of space in the
> statement is causing this.
> On trying it like select -1 != -1; it works fine.
Right, see
https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-OPERATORS
particularly the bit about "A multiple-character operator name cannot
end in + or -, unless ...". "!=-" will be treated as one operator,
but "<>-" will not.
regards, tom lane