Re: Document NULL - Mailing list pgsql-hackers

From Marcos Pegoraro
Subject Re: Document NULL
Date
Msg-id CAB-JLwZ5_njOrbJibVJ2TQt+bF7haX5K3AZtGHsqh5AsT_2NgA@mail.gmail.com
Whole thread Raw
In response to Re: Document NULL  (Marcos Pegoraro <marcos@f10.com.br>)
List 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 by date:

Previous
From: Yogesh Sharma
Date:
Subject: Re: Add a write_to_file member to PgStat_KindInfo
Next
From: Thomas Simpson
Date:
Subject: circle @> box, polygon points access