Re: json accessors - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: json accessors
Date
Msg-id 50BF82E6.3000105@dunslane.net
Whole thread Raw
In response to Re: json accessors  ("David E. Wheeler" <david@justatheory.com>)
List pgsql-hackers
On 12/05/2012 12:11 PM, David E. Wheeler wrote:
> On Dec 4, 2012, at 10:05 AM, Josh Berkus <josh@agliodbs.com> wrote:
>
>>>     json_get(json, variadic text) => json
>> Given that I already do the equivalent in Python, this would suit me
>> well.  Not sure about other users ...
> Well, given that sometimes you will have mixed arrays and objects, how would you distinguish "42" as an object key or
anarray index?
 


if the thing is an array, test to see if the string is a valid integer 
string, and if so use the integer value.


cheers

andrew



pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: json accessors
Next
From: Andrew Dunstan
Date:
Subject: Re: json accessors