我正在工作
CREATE TABLE delme (
id bigint,
s timestamp,
e timestamp,
CHECK (s < e),
CONSTRAINT overlapping EXCLUDE USING gist (
tsrange(s, e) WITH &&
)
);
但是我很感兴趣为什么我不能使用它
CREATE TABLE delme (
id bigint,
s timestamp,
e timestamp,
CHECK (s < e),
CONSTRAINT overlapping EXCLUDE USING gist (
(s, e) WITH OVERLAPS
)
);
大概不会在运行时创建新的数据结构来检查约束,而是使用标准sql OVERLAPS
。