Re: BUG #18689: psql : operator "!=" do not behave like "<>"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
Cc: jhecht(at)cirilgroup(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18689: psql : operator "!=" do not behave like "<>"
Date: 2024-11-05 14:56:22
Message-ID: 3048696.1730818582@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Erik Wienhold 2024-11-05 15:05:05 Re: BUG #18689: psql : operator "!=" do not behave like "<>"
Previous Message Rafia Sabih 2024-11-05 13:02:36 Re: BUG #18689: psql : operator "!=" do not behave like "<>"