1

I'm wondering how to correctly create an index that would index the keys of a JSONB column that has the following shape:

{
  "perm1": true,
  "perm2": false,
  "perm3": true
}

Basically I'd like the lookup of perm1, perm2 and perm3 to be the keys to reference. I don't know the values of the keys so I can't using the regular create index. I did find this as a suggestion:

CREATE INDEX idx_visitors ON visitors USING GIN (jsonb jsonb_path_value_ops);

Is there a more appropriate way of creating asserting this index?

pilotguy
  • 543
  • 1
  • 5
  • 18
  • Good point, SO doesn't make it easy to select the higher version of Postgres. I selected 14 as my question category now to clarify. – pilotguy Oct 31 '22 at 21:54

0 Answers0