pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres jsonb data
2+ messages / 2 participants
[nested] [flat]
* Postgres jsonb data
@ 2025-05-20 13:41 PG Doc comments form <noreply@postgresql.org>
2025-05-21 06:12 ` Re: Postgres jsonb data Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2025-05-20 13:41 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: stephen@infowerks.com
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/14/datatype-json.html
Description:
Documentation suggests that a json type of null doesn't turn into anything
when read into a jsonb, because the json type of null doesn't correspond to
the postgres type of NULL. We've found that in fact it's treated the same
as the string "null" - and the documentation probably should reflect this
edge case.
We're currently using Postgres 14, and it's possible that this has changed
in later versions, but I'm using the Postgres 14 documentation - and this is
table 8.23 in that version of the documentation (formatting doesn't copy
from the webpage into this form):
Table 8.23. JSON Primitive Types and Corresponding PostgreSQL Types
JSON primitive type PostgreSQL type Notes
string text \u0000 is disallowed, as are Unicode escapes representing
characters not available in the database encoding
number numeric NaN and infinity values are disallowed
boolean boolean Only lowercase true and false spellings are accepted
null (none) SQL NULL is a different concept
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Postgres jsonb data
2025-05-20 13:41 Postgres jsonb data PG Doc comments form <noreply@postgresql.org>
@ 2025-05-21 06:12 ` Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 0 replies; 2+ messages in thread
From: Laurenz Albe @ 2025-05-21 06:12 UTC (permalink / raw)
To: stephen@infowerks.com; pgsql-docs@lists.postgresql.org
On Tue, 2025-05-20 at 13:41 +0000, PG Doc comments form wrote:
> Page: https://www.postgresql.org/docs/14/datatype-json.html
>
> Documentation suggests that a json type of null doesn't turn into anything
> when read into a jsonb, because the json type of null doesn't correspond to
> the postgres type of NULL. We've found that in fact it's treated the same
> as the string "null" - and the documentation probably should reflect this
> edge case.
I see them treated differently:
SELECT 'null'::jsonb IS NULL;
?column?
══════════
f
(1 row)
Can you show examples of what you mean?
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-05-21 06:12 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-05-20 13:41 Postgres jsonb data PG Doc comments form <noreply@postgresql.org>
2025-05-21 06:12 ` Laurenz Albe <laurenz.albe@cybertec.at>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox