There is a table like following:
CREATE TABLE test (my_field jsonb NOT NULL)
The my_field has a key like collection which stores values in varchar[] format:
{my_field: {collection: ['a', 'b', 'c']}}
I know that it is possible to set unique index for simple json values. For instance, for {my_field: {name: 'Someone'}}, uniqe constraint could be set. (gave it a try already)
I have tried exclude using gist a lot, but I've got nothing so far.
Is it possible to set unique(considering overlapping) constraint in this situation?
Thanks in advance.
If it is not matter of ordering then simple index will work: