pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feed回复:Re: The != and +/- signs are joined together as an operator
2+ messages / 2 participants
[nested] [flat]
* 回复:Re: The != and +/- signs are joined together as an operator
@ 2025-03-20 01:11 =?utf-8?B?6LCt5b+g5rab?= <zhongtao.tan@seaboxdata.com>
0 siblings, 1 reply; 2+ messages in thread
From: 谭忠涛 @ 2025-03-20 01:11 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; David G. Johnston <david.g.johnston@gmail.com>; +Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: 回复:Re: The != and +/- signs are joined together as an operator
@ 2025-03-20 01:44 Tom Lane <tgl@sss.pgh.pa.us>
parent: =?utf-8?B?6LCt5b+g5rab?= <zhongtao.tan@seaboxdata.com>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2025-03-20 01:44 UTC (permalink / raw)
To: 谭忠涛 <zhongtao.tan@seaboxdata.com>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; pgsql-bugs <pgsql-bugs@lists.postgresql.org>
"=?utf-8?B?6LCt5b+g5rab?=" <zhongtao.tan@seaboxdata.com> writes:
> 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
[ shrug... ] It's not going to happen. The PG project's position,
as stated in the docs I pointed you to, is that you should write a
space between adjacent operators. The SQL spec thinks differently,
so we've made sure that you can leave out space between operators
that are defined in the SQL standard, but that's as far as we'll go.
There are too many existing operators, both within PG core and
elsewhere, that would be broken by changing those rules now.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-03-20 01:44 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-03-20 01:11 回复:Re: The != and +/- signs are joined together as an operator =?utf-8?B?6LCt5b+g5rab?= <zhongtao.tan@seaboxdata.com>
2025-03-20 01:44 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox