| From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
|---|---|
| To: | "David E(dot) Wheeler" <david(at)justatheory(dot)com> |
| Cc: | Andres Freund <andres(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: JSON Function Bike Shedding |
| Date: | 2013-02-17 20:53:44 |
| Message-ID: | 51214358.6040401@dunslane.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 02/17/2013 01:19 PM, David E. Wheeler wrote:
> On Feb 17, 2013, at 6:33 AM, Andrew Dunstan <andrew(at)dunslane(dot)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 cover all 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-dozen of 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dimitri Fontaine | 2013-02-17 21:12:57 | Re: sql_drop Event Trigger |
| Previous Message | Thom Brown | 2013-02-17 20:23:57 | Re: Materialized views WIP patch |