Re: BUG #13289: ANY() function produces a paradox

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #13289: ANY() function produces a paradox
Дата
Msg-id CAKFQuwY_oP1R6U-0QLwvbDLyEdZan6LOHMAT76dmLg+Sah+-fA@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #13289: ANY() function produces a paradox  (udtelco@gmail.com)
Ответы Re: BUG #13289: ANY() function produces a paradox  (Anton Pavlov <udtelco@gmail.com>)
Список pgsql-bugs
On Thu, May 14, 2015 at 10:12 AM, <udtelco@gmail.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      13289
> Logged by:          Anton
> Email address:      udtelco@gmail.com
> PostgreSQL version: 9.3.2
> Operating system:   Solaris 11.2
> Description:
>
> select ('2' !=3D any('{2,3}')) , ('2' =3D any('{2,3}'))
>
> When !=3D (or <>) operator is applied to any() , results are wrong. There=
by,
> you have a situation where x =3D y AND x !=3D y both evaluating as true.
>

=E2=80=8B=E2=80=8BAs Tom said.=E2=80=8B

=E2=80=8BAnd what is "y" in your argument?=E2=80=8B

This is shorthand for:

('2' !=3D '2' OR '2' !=3D '3')=E2=80=8B, ('2' =3D '2' OR '2' =3D '3')

=E2=80=8B=E2=80=8BIf you define "y" as the expression "any('{2,3}')" then i=
t is not even of
the same type as the scalar '2' so a literal comparison is undefined.
Therefore, PostgreSQL treats it as syntactic sugar for the compound boolean
expression (x op y[1] OR x op y[2] OR ...)

David J.

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #13289: ANY() function produces a paradox
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #13289: ANY() function produces a paradox