Re: BUG #11178: JSONB : The NOT operator applies to the <@ operator, even after casting to ::bool

Поиск
Список
Период
Сортировка
От Christian Pronovost
Тема Re: BUG #11178: JSONB : The NOT operator applies to the <@ operator, even after casting to ::bool
Дата
Msg-id 1408369143374-5815229.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: BUG #11178: JSONB : The NOT operator applies to the <@ operator, even after casting to ::bool  (David G Johnston <david.g.johnston@gmail.com>)
Ответы Re: BUG #11178: JSONB : The NOT operator applies to the <@ operator, even after casting to ::bool  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-bugs
David G Johnston wrote
> The presence of "NOT" does not (aside from a possible bug) change the "<@"
> operator into the "@>" operator.

I was wrong assuming the inversion of the "<@" operator.


> "NOT" simply inverts the supplied boolean value.

This does not seem to be the case. In the following example, the same query
returns false whether there is a NOT operator or not.

SELECT (testcolumn->'ID' <@ '["2"]') FROM "TestJsonb" --Returns false (as
expected)
SELECT NOT(testcolumn->'ID' <@ '["2"]') FROM "TestJsonb" --Returns false
(*not as expected*)

To be noted that outside of the context of a table, this works fine:

SELECT ('"1"'::jsonb <@ '["2"]') --Returns false (as expected)
SELECT NOT('"1"'::jsonb <@ '["2"]') --Returns true (as expected)

I am confused



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/BUG-11178-JSONB-The-NOT-operator-applies-to-the-operator-even-after-casting-to-bool-tp5815056p5815229.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

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

Предыдущее
От: tony.locke@wessexwater.co.uk
Дата:
Сообщение: BUG #11204: Log reason for authentication failure
Следующее
От: David G Johnston
Дата:
Сообщение: Re: BUG #11178: JSONB : The NOT operator applies to the <@ operator, even after casting to ::bool