GIN over array of ENUMs

Started by Rod Taylorabout 13 years ago2 messages
#1Rod Taylor
pg@rbt.ca

I wish to create this data structure but GIN does not currently support an
array of ENUM. Is intarray() a good place to look into adding ENUM support
or is there already an operator class for working supports enums that I
simply don't see at the moment.

This is being done as an alternative to a very large number of boolean
columns which are rarely true (under 1%).

CREATE TYPE feature AS ENUM ('item1', 'item2', 'item3');
CREATE TABLE test (id serial PRIMARY KEY, features feature[]);

CREATE INDEX test_features_idx ON test USING GIN (features, id);

ERROR: data type feature[] has no default operator class for access method
"gin"
HINT: You must specify an operator class for the index or define a default
operator class for the data type.

Thanks in advance,

Rod

#2Robert Haas
robertmhaas@gmail.com
In reply to: Rod Taylor (#1)
Re: GIN over array of ENUMs

On Thu, Jan 10, 2013 at 12:08 PM, Rod Taylor <pg@rbt.ca> wrote:

I wish to create this data structure but GIN does not currently support an
array of ENUM. Is intarray() a good place to look into adding ENUM support
or is there already an operator class for working supports enums that I
simply don't see at the moment.

What does intarray have to do with enums?

If you're talking about contrib/intarray, I suspect that's not a
particularly good place to do anything, except maybe rm -rf .

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers