An exception about comparison operators

Поиск
Список
Период
Сортировка
От 张元超
Тема An exception about comparison operators
Дата
Msg-id 32742bcd.ad58.179a7f4adff.Coremail.chaoge145@163.com
обсуждение исходный текст
Список pgsql-general
Hi,everyone,
I encountered a problem when using PostgreSQL's comparison operators. The problem is as follows:
Problem Description:
When I use the comparison operator "!=" as the query condition, such as "select * from t1 where c1 !=-1", the database returns an error: "!=-operator does not exist". Because there is no space between ‘=’ and ‘-’, if you enter a space between them, the sql can be executed normally. Therefore, although we can make sql execute normally by adding spaces, its behavior is different from other comparison operators (such as ">,<,>=,<=,=,<>"). Other comparisons Operators will not have such problems.

I guess that this should be because the database did not correctly handle the "!=" operator during sql parsing, so I think this should be a bug. This problem exists in the 11, 12, and 13 versions of PostgreSQL.

At the same time, I tried other databases, such as Oracle, but did not find the same problem.
Looking forward to your reply.

Thans very much!




 

В списке pgsql-general по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Null database entry in pg_stat_database on pg-12 version
Следующее
От: Rob Sargent
Дата:
Сообщение: How different is AWS-RDS postgres?