Re: jsonb array-style subscripting
Kaare Rasmussen <kaare@jasonic.dk>
From: Kaare Rasmussen <kaare@jasonic.dk>
To: <pgsql-hackers@postgresql.org>
Date: 2015-08-18T05:11:15Z
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
Commits
-
Throw error when assigning jsonb scalar instead of a composite object
- aa6e46daf530 14.0 landed
-
Filling array gaps during jsonb subscripting
- 81fcc72e6622 14.0 landed
-
Implementation of subscripting for jsonb
- 676887a3b0b8 14.0 landed