> On 2 Jun 2020, at 9:30, Shaheed Haque wrote:
>
>
>> I do something like this to get a set of sub-paths in a JSONB field (no idea
>> how to write that in Django):
>>
>> select snapshot->’pay_definition’->k.value->’name’
>> from MyModel
>> join lateral jsonb_object_keys(snapshot->’pay_de
> One question: as a novice here, I think I understand the right hand
> side of your JOIN "... k(value)" is shorthand for:
>
> ... AS table_name(column_name)
>
> except that I don't see any clues in the docs that
> jsonb_object_keys() is a "table function".> Can you kindly clarify?
The clue is in
>
> Hi,
>
> On Mon, 1 Jun 2020 at 23:50, Alban Hertroys wrote:
> > On 1 Jun 2020, at 20:18, Shaheed Haque wrote:
> >
> > Hi,
> >
> > I'm using Django's ORM to access Postgres12. My "MyModel" table has a
> JSONB column called 'snapshot'. In Python terms, each row's 'snapshot'
> looks like this:
> On 1 Jun 2020, at 20:18, Shaheed Haque wrote:
>
> Hi,
>
> I'm using Django's ORM to access Postgres12. My "MyModel" table has a JSONB
> column called 'snapshot'. In Python terms, each row's 'snapshot' looks like
> this:
>
> ==
> snapshot = {
> 'pay_definition' : {
Hi,
I'm using Django's ORM to access Postgres12. My "MyModel" table has a JSONB
column called 'snapshot'. In Python terms, each row's 'snapshot' looks like
this:
==
snapshot = {
'pay_definition' : {
'1234': {..., 'name': 'foo', ...},
'99': {..., 'name': 'ba