Re: JSON Function Bike Shedding - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: JSON Function Bike Shedding
Date
Msg-id 51214358.6040401@dunslane.net
Whole thread Raw
In response to Re: JSON Function Bike Shedding  ("David E. Wheeler" <david@justatheory.com>)
List pgsql-hackers
On 02/17/2013 01:19 PM, David E. Wheeler wrote:
> On Feb 17, 2013, at 6:33 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
>
>> No, then we don't have a variadic version. You are going to have to accept that we can't make one function name
coverall of this. 
> Well, for me, I would rather specify an array than call a function with a different name. But it’s six of one,
half-dozenof another, really, as long as it all works. 
>
>


I am going to go the way that involves the least amount of explicit
casting or array construction. So get_path() stays, but becomes
non-variadic. get() can take an int or variadic text[], so you can do:
    get(myjson,0)    get(myjson,'f1')    get(myjson,'f1','2','f3')    get_path(myjson,'{f1,2,f3}')


cheers

andrew



pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: Materialized views WIP patch
Next
From: "P. Christeas"
Date:
Subject: Re: [RFC] ideas for a new Python DBAPI driver (was Re: libpq test suite)