문제

I need to have something equivalent to this exclusion constraint

drop table if exists t;
create table t (
    i int,
    tsr tstzrange,
    exclude using gist (i with =, tsr with &&)
);
ERROR:  data type integer has no default operator class for access method "gist"
HINT:  You must specify an operator class for the index or define a default operator class for the data type.

I guess the problem is obvious from the error message. How to do it?

도움이 되었습니까?

해결책

You need to install the additional module btree_gist to make it work. The module installs the missing operator class.

Details in this related answer:

More at this answer on dba.SE:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top