Re: json accessors

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: json accessors
Date: 2012-12-05 17:22:46
Message-ID: 50BF82E6.3000105@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 12/05/2012 12:11 PM, David E. Wheeler wrote:
> On Dec 4, 2012, at 10:05 AM, Josh Berkus <josh(at)agliodbs(dot)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 an array 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2012-12-05 17:24:42 Re: PITR potentially broken in 9.2
Previous Message Andrew Dunstan 2012-12-05 17:21:02 Re: json accessors