Re: Document NULL

From: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(at)eisentraut(dot)org>, David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Document NULL
Date: 2024-11-21 18:08:27
Message-ID: CAB-JLwZ5_njOrbJibVJ2TQt+bF7haX5K3AZtGHsqh5AsT_2NgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em qui., 21 de nov. de 2024 às 12:02, Marcos Pegoraro <marcos(at)f10(dot)com(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Simpson 2024-11-21 18:18:23 circle @> box, polygon points access
Previous Message Nathan Bossart 2024-11-21 18:00:37 revamp row-security tracking