Reputation: 805
I created table using exclude constraint.but i do not know the use of gist in exclude constraint?Why we specify the gist keyword in exclude constraint?.Any specify reason for this.
CREATE TABLE Employee_age_Details(
name varchar(50),
age integer,
EXCLUDE USING gist
(age WITH <>));
Upvotes: 0
Views: 594
Reputation: 44147
The default index type, Btree, does not offer support for the '<>' operator. The GiST index type (under btree_gist) does. You must use an index type which supports the operator.
If you changed the constraint operator to '=', then you could omit the "gist". But in that case you should just use a unique constraint, as it does the same thing better.
Upvotes: 3