Re: Document NULL

Поиск
Список
Период
Сортировка
От Marcos Pegoraro
Тема Re: Document NULL
Дата
Msg-id CAB-JLwZ5_njOrbJibVJ2TQt+bF7haX5K3AZtGHsqh5AsT_2NgA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Document NULL  (Marcos Pegoraro <marcos@f10.com.br>)
Список pgsql-hackers
Em qui., 21 de nov. de 2024 às 12:02, Marcos Pegoraro <marcos@f10.com.br> escreveu:

Well, all comparisons with JSONs runs differently with null values, so maybe an example would help

select f1 = f2 "JS Object Equal - Right",
       f1->'a' = f2->'a' "JS Value Equal - Right",
       f1->>'a' = f2->>'a' "Text Equal - Wrong",
       f1->>'a' IS NOT DISTINCT FROM f2->>'a' "Text Distinct - Right"
from (Values ('{"a": 5}'::jsonb, '{"a": null}'::jsonb)) x(f1,f2)

"JSON values, independently if null or not, are compared using Equal and not Equal operators, so here we don't have the IS DISTINCT operator"

regards
Marcos

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