我需要具有与此exclusion
约束相等的内容
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.
我猜错误信息显而易见。怎么做?
答案 0 :(得分:4)
您需要安装附加模块btree_gist
才能使其正常运行。该模块安装了缺少的操作符类。
此相关答案的详情:
Exclusion constraint on a bitstring column with bitwise AND operator
更多关于dba.SE的回答:
PostgreSQL EXCLUDE USING error: Data type integer has no default operator class