【发布时间】:2018-12-04 04:42:38
【问题描述】:
我有一个复合类型。我想在它上面定义排除约束,这也将与范围排除相结合,但得到以下错误。
create type example_t as (
x uuid,
y text
);
create table example (
id example_t not null,
time tstzrange not null,
exclude using gist (id with =, time with &&)
);
ERROR: data type example_t 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. SQL state: 42704
如何定义'example_t'复合类型的操作符类?
【问题讨论】:
标签: postgresql composite-types range-types gist-index