Re: How to select values in a JSON type of column? - Mailing list pgsql-general

From David G. Johnston
Subject Re: How to select values in a JSON type of column?
Date
Msg-id CAKFQuwYVfGGHem7f06Hn=Ex5ZMNCkoPGf4c7EoUiittm8M1hgg@mail.gmail.com
Whole thread Raw
In response to How to select values in a JSON type of column?  (Snjezana Frketic <frketic.snjezana@gmail.com>)
Responses Re: How to select values in a JSON type of column?  (Snjezana Frketic <frketic.snjezana@gmail.com>)
List pgsql-general

On Wednesday, November 18, 2020, Snjezana Frketic <frketic.snjezana@gmail.com> wrote:


SELECT targeting#>'{targets,0,audienceSegments,0,includes,0,segments,allOf,0,ids}'FROM campaigns;  

and that works, but, I don’t want to have a fixed path because positions could change like 0 could become 1includes and excludes could change positions, allOf  could be anyOf etc.
Any idea of how to always select ids in includes no matter the changes?

  Maybe it can be done using json path:


David J.

pgsql-general by date:

Previous
From: Ravi Krishna
Date:
Subject: Re: vacuum vs vacuum full
Next
From: Snjezana Frketic
Date:
Subject: Re: How to select values in a JSON type of column?