Re: JSON NULLs

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JSON NULLs
Date: 2013-02-06 19:24:41
Message-ID: CAHyXU0z68dOLCta-Cg0MyDt1pJ2dDc4Ei_fV7MfR8VOr-CfUgQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 6, 2013 at 1:08 PM, David E. Wheeler <david(at)justatheory(dot)com> wrote:
> Hackers,
>
> While playing with Andrew’s JSON enhancements, I noticed this:
>
> david=# select * From json_each_as_text('{"baz": null}'::json);
> key | value
> -----+-------
> baz | null
>
> It is returning 'null'::text there, not NULL::text. I had expected the latter, because otherwise it's not possible to tell the difference between '{"foo": null}' and '{"foo": "null"}'.

IMO, this is bug in proposed implementation. json unquoted null
should not map to string 'null' but to SQL, casting behavior from
text as implemented looks correct. (only SQL null should produce json
null)

merlin

In response to

  • JSON NULLs at 2013-02-06 19:08:38 from David E. Wheeler

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2013-02-06 19:36:39 Re: JSON NULLs
Previous Message Andres Freund 2013-02-06 19:20:13 Re: palloc unification