回复:Re: The != and +/- signs are joined together as an operator - Mailing list pgsql-bugs

From 谭忠涛
Subject 回复:Re: The != and +/- signs are joined together as an operator
Date
Msg-id tencent_66B9FBC77B1326A007855EB1@qq.com
Whole thread Raw
List pgsql-bugs
But "!=" is not the same as  "<>"
1!=-1,  "!=-" as a whole is treated as an operator, not as an operator "!=" -1, but in 1<>-1, it is treated as "<>" -1 instead of "<>-" as a whole  is treated as an operator
I think "!=" and "<>" should be treated in the same way

Regards

Tom Lane<tgl@sss.pgh.pa.us> 在 2025年3月19日 周三 22:34 写道:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tuesday, March 18, 2025, 谭忠涛 <zhongtao.tan@seaboxdata.com> wrote:
>> select 1 !=-1;
>> select 1 !=+1;

> Explain why you think it is a bug.  From what I see those are potentially
> valid operator names that do not exist so “operator not found” is the
> correct outcome.

Our rules for operator names are here:

https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-OPERATORS

regards, tom lane

pgsql-bugs by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: BUG #18855: Using BRIN index with int8_bloom_ops produces incorrect results
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #18760: ../doc/src/sgml/postgres.sgml:24: element book: validity error : No declaration for attribute id of