Re: JSON Function Bike Shedding

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JSON Function Bike Shedding
Date: 2013-02-13 17:31:32
Message-ID: 511BCDF4.7020905@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 02/13/2013 12:07 PM, David E. Wheeler wrote:
> On Feb 13, 2013, at 8:36 AM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
>> I don't have any problem getting rid of the json_ prefixes, except for json_agg which I think should keep it (c.f. string_agg, array_agg).
> I think that's an unfortunately naming forced on us by the SQL standard, and it doesn't mean we have to use it anyway.

Regardless of that, I'd prefer to be consistent.

>> I think Merlin's suggestion if unwrap might be good. Or simply "elements()" might work.
> Perhaps unwrap() returns a set and elements() returns an array?

Now you're adding functionality. Let's just keep this to the question of
names.

>> I think this is beyond bikeshedding. Apparently you have missed the existence of json_object_keys().
> Oh, I forgot it returned a set rather than an array. So I suggest:
>
> values() - Returns an array
> keys() - Returns an array
>
> And:
>
> unwrap() - Returns a set
> skeys() - Returns a set
>
> Er, okay, so skeys() sucks alongside the others here. If we were to steal from hstore, these would be:
>
> svals() - Returns a set
> skeys() - Returns a set
> avals() - Returns an array
> akeys() - Returns an array
>
> I don’t love those, but if we want to follow precedent…

Ditto. I think we're a bit late to be adding functionality.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Atri Sharma 2013-02-13 17:32:13 Re: Fractal tree indexing
Previous Message Pavel Stehule 2013-02-13 17:25:25 Re: JSON Function Bike Shedding