Re: json (b) and null fields

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 19:13:50
Message-ID: CAFj8pRB6W5UkoX8wxOcxyf0TrLj4jtvSq2cN5CmFS9kgAukEqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2014-09-28 18:35 GMT+02:00 Andrew Dunstan <andrew(at)dunslane(dot)net>:

>
> On 09/27/2014 11:58 PM, Stephen Frost wrote:
>
>> All,
>>
>>
>> On Saturday, September 27, 2014, Andrew Dunstan <andrew(at)dunslane(dot)net
>> <mailto:andrew(at)dunslane(dot)net>> wrote:
>>
>>
>> On 09/27/2014 10:52 PM, Tom Lane wrote:
>>
>> Andrew Dunstan <andrew(at)dunslane(dot)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.

In other mail you wrote, how much important is this functionality for JSON,
so I don't think so a movement to contrib is a good idea.

We can implement all described functionality in separate function, but it
should be in core probably. It is not my idea. I was asked about this
functionality by some PostgreSQL 9.4 early users and testers on Czech
mailing list.

Regards

Pavel

>
>
> cheers
>
> andrew
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2014-09-29 19:17:44 Re: json (b) and null fields
Previous Message Peter Geoghegan 2014-09-29 19:10:00 Re: effective_io_concurrency documentation