Re: jsonb array-style subscripting - Mailing list pgsql-hackers

From Kaare Rasmussen
Subject Re: jsonb array-style subscripting
Date
Msg-id 55D2BE73.5010508@jasonic.dk
Whole thread Raw
In response to Re: jsonb array-style subscripting  (Josh Berkus <josh@agliodbs.com>)
Responses Re: jsonb array-style subscripting  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 2015-08-17 22:33, Josh Berkus wrote:
> So, both perl and python do not allow "deep nesting" of assignments. 
> For example:
>>>> d = { "a" : { } }
>>>> d["a"]["a1"]["a2"] = 42
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
> KeyError: 'a1'

Not sure I understand what you mean. In Perl you'd do

$ perl -e '%d = (a => {}); $d{a}{a1}{a2} = 42; print $d{a}{a1}{a2}'
42

which looks pretty much like what's proposed.

/kaare



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: WIP: SCRAM authentication
Next
From: Jim Nasby
Date:
Subject: Re: [PROPOSAL] VACUUM Progress Checker.