> On Apr 27, 2019, at 12:55 AM, Andrew Gierth <and...@tao11.riddles.org.uk> 
> wrote:
> 
> Obvious solution:
> 
> create function uuid_keys(mapData jsonb) returns uuid[]
>  language plpgsql immutable strict
>  as $$
>    begin
>      return array(select jsonb_object_keys(mapData)::uuid);
>    end;
>  $$;
> 
> create index on tbl using gin (uuid_keys(mapData));
> 
> select * from tbl where uuid_keys(mapData) && array[...];

Thank you Andrew, I modified it slightly to use `language sql` but otherwise
it gets me going forward.



Reply via email to