When I add an exclude constraint on a table to prevent two rows with same value in int[], I got this error message:
data type integer[] has no default operator class for access method "gist"
I have a table like this:
CREATE TABLE x (
id SERIAL PRIMARY KEY,
ref_id INT REFERENCES x,
purchase_ids INT[],
EXCLUDE USING GIST(purchase_ids WITH &&) WHERE(ref_id IS NULL)
);
PRIMARY KEYfor thepurchase_idsinstead of anint[]. Do you really need to store the data in an array?