Re: differences between <> and != when using signed values on the right hand side

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: differences between <> and != when using signed values on the right hand side
Дата
в 16:34:50
Msg-id
2111156.1715877290@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
differences between <> and != when using signed values on the right hand side David Hunnisett <david.hunnisett@probit.io>
Re: differences between <> and != when using signed values on the right hand side "David G. Johnston" <david.g.johnston@gmail.com>
Re: differences between <> and != when using signed values on the right hand side Tom Lane <tgl@sss.pgh.pa.us>
"David G. Johnston"  writes:
> On Thursday, May 16, 2024, David Hunnisett 
> wrote:
>> When using a signed comparison != does not behave like <> if the right
>> hand side comparator is signed and there is no space between the comparator
>> and the sign

> This is not a bug.  You are seeing practical examples of the behavior
> documented here:
> https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-OPERATORS

Yeah, it would probably have been better to forbid multicharacter
operator names that end in '+' or '-'.  But that ship sailed a long
time ago, so we have this kluge to (effectively) allow it only if
the operator can't be a SQL-standard one.  Thus, in the example
"!=-" is being read as a single operator name.

			regards, tom lane


В списке pgsql-bugs по дате отправления
От: Japin Li
Дата:
От: Andres Freund
Дата:
FAQ