index on values stored in a json array - Mailing list pgsql-sql

From Raphael Bauduin
Subject index on values stored in a json array
Date
Msg-id CAONrwUEJ2VuUS=5R1whJPcnZfOoPtfkonDgOBsedw6A48RVsCA@mail.gmail.com
Whole thread Raw
Responses Re: index on values stored in a json array  ("Jonathan S. Katz" <jonathan.katz@excoventures.com>)
List pgsql-sql
<div dir="ltr">Hi,<br /><br />I have a table with a column of type json, in which arrays of products are stored in the
form:<br/><br />{products: [ {id : 123 , name ='product1'}, {id: 214, name: 'product 2}], size: 'XL'}<br /><br />Is is
possibleto create an index on the row's products' ids?<br />I know I have to use GIN index, but I don't know how to
collectthe product ids out of the array in the create index command.<br /><br />Thanks in advance<br /><br />raph<br
/></div>

pgsql-sql by date:

Previous
From: "Jonathan S. Katz"
Date:
Subject: Re: Number of days in a tstzrange?
Next
From: "Jonathan S. Katz"
Date:
Subject: Re: index on values stored in a json array