On 02/17/2013 01:19 PM, David E. Wheeler wrote:
On Feb 17, 2013, at 6:33 AM, Andrew Dunstan <and...@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 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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers