Re: WIP json generation enhancements - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: WIP json generation enhancements
Date
Msg-id 50B3C71C.5060906@2ndQuadrant.com
Whole thread Raw
In response to Re: WIP json generation enhancements  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: WIP json generation enhancements
Re: WIP json generation enhancements
List pgsql-hackers
On 11/26/2012 08:12 PM, Peter Eisentraut wrote:
> On 11/21/12 3:16 PM, Andrew Dunstan wrote:
>> One open question regarding this feature is whether this should return
>> NULL or '[]' for 0 rows. Currently it returns NULL but I could be
>> convinced to return '[]', and the change would be very small.
> Although my intuition would be [], the existing concatenation-like
> aggregates return null for no input rows, so this probably ought to be
> consistent with those.
>
In some previous mail Tom Lane claimed that by SQL standard
either an array of all NULLs or a record with all fields NULLs (I
don't remember which) is also considered NULL. If this is true,
then an empty array - which can be said to consist of nothing
but NULLs - should itself be NULL.

If this is so, than the existing behaviour of returning NULL in such
cases is what standard requires.

Hannu Krosing



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: foreign key locks
Next
From: Alexander Korotkov
Date:
Subject: Re: WIP: index support for regexp search