Re: jsonb array-style subscripting

From: Kaare Rasmussen <kaare(at)jasonic(dot)dk>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb array-style subscripting
Date: 2015-08-18 05:11:15
Message-ID: 55D2BE73.5010508@jasonic.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2015-08-18 05:15:36 Re: [PROPOSAL] VACUUM Progress Checker.
Previous Message Michael Paquier 2015-08-18 04:35:46 Re: WIP: SCRAM authentication