Re: json (b) and null fields - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: json (b) and null fields
Date
Msg-id 542838CB.6000400@dunslane.net
Whole thread Raw
In response to Re: json (b) and null fields  (Stephen Frost <sfrost@snowman.net>)
Responses Re: json (b) and null fields  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On 09/27/2014 11:58 PM, Stephen Frost wrote:
> All,
>
> On Saturday, September 27, 2014, Andrew Dunstan <andrew@dunslane.net 
> <mailto:andrew@dunslane.net>> wrote:
>
>
>     On 09/27/2014 10:52 PM, Tom Lane wrote:
>
>         Andrew Dunstan <andrew@dunslane.net> writes:
>
>             On 09/27/2014 06:27 PM, Tom Lane wrote:
>
>                 So my vote is for a separate function and no optional
>                 arguments.
>
>             You mean like row_to_json_no_nulls() and json_agg_no_nulls()?
>
>         I thought you were proposing that we should revert the
>         committed patch
>         lock-stock-n-barrel, and instead invent json_strip_null_fields().
>         That's instead, not in addition to.  Even if you weren't
>         saying that
>         exactly, that's where my vote goes.
>
>
>
>     I was just exploring alternatives. But I think that's where my
>     vote goes too.
>
>
> I'm fine with that. I'd like the strip-Nulls capability, but seems 
> like it'd be better off as an independent function (or functions) 
> instead.
>
>

Unlike the row_to_json stuff, json{b}_strip_null_fields() can almost 
certainly be done as a small extension. One advantage of that is that it 
would be used with 9.4.

cheers

andrew




pgsql-hackers by date:

Previous
From: Shay Rojansky
Date:
Subject: Re: Proper query implementation for Postgresql driver
Next
From: Bogdan Pilch
Date:
Subject: Time measurement format - more human readable