Gin index on array of uuid - Mailing list pgsql-hackers

From Enrique MailingLists
Subject Gin index on array of uuid
Date
Msg-id CADCw5QZctww5Q1MiTEx9OtOhT4g421Ftds=1MtTepqM2hLnrCQ@mail.gmail.com
Whole thread Raw
Responses Re: Gin index on array of uuid
Re: Gin index on array of uuid
List pgsql-hackers

Currently creating an index on an array of UUID involves defining an operator class. I was wondering if this would be a valid request to add as part of the uuid-ossp extension? This seems like a reasonable operator to support as a default for UUIDs. Any downsides to adding this as a default?


This is the definition from the stack overflow reference:

CREATE OPERATOR CLASS _uuid_ops DEFAULT   FOR TYPE _uuid USING gin AS   OPERATOR 1 &&(anyarray, anyarray),   OPERATOR 2 @>(anyarray, anyarray),   OPERATOR 3 <@(anyarray, anyarray),   OPERATOR 4 =(anyarray, anyarray),   FUNCTION 1 uuid_cmp(uuid, uuid),   FUNCTION 2 ginarrayextract(anyarray, internal, internal),   FUNCTION 3 ginqueryarrayextract(anyarray, internal, smallint, internal, internal, internal, internal),   FUNCTION 4 ginarrayconsistent(internal, smallint, anyarray, integer, internal, internal, internal, internal),   STORAGE uuid;

This would be helpful for people trying to use arrays of UUIDs in cloud environments which limit root access.

Thank you,
Enrique

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Reviewing freeze map code
Next
From: Peter Geoghegan
Date:
Subject: Re: Gin index on array of uuid