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

From: 谭忠涛 <zhongtao(dot)tan(at)seaboxdata(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David G(dot) Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: 回复:Re: The != and +/- signs are joined together as an operator
Date: 2025-03-20 01:11:33
Message-ID: tencent_66B9FBC77B1326A007855EB1@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

But "!=" is not the same as&nbsp; "<&gt;"

1!=-1,&nbsp; "!=-" as a whole is treated as an operator, not as an operator "!=" -1, but in 1<&gt;-1, it is treated as "<&gt;" -1 instead of "<&gt;-" as a whole&nbsp; is treated as an operator
I think "!=" and "<&gt;" should be treated in the same way

Regards

Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us&gt;&nbsp;在 2025年3月19日 周三 22:34 写道:

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com&gt; writes:
&gt; On Tuesday, March 18, 2025, 谭忠涛 <zhongtao(dot)tan(at)seaboxdata(dot)com&gt; wrote:
&gt;&gt; select 1 !=-1;
&gt;&gt; select 1 !=+1;

&gt; Explain why you think it is a bug.&nbsp; From what I see those are potentially
&gt; valid operator names that do not exist so “operator not found” is the
&gt; 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2025-03-20 01:32:58 Re: BUG #18760: ../doc/src/sgml/postgres.sgml:24: element book: validity error : No declaration for attribute id of
Previous Message Tomas Vondra 2025-03-19 19:53:50 Re: BUG #18855: Using BRIN index with int8_bloom_ops produces incorrect results