我有一个复合类型。我想对其定义排除约束,这也将与范围排除相结合,但会出现以下错误。
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”复合类型定义运算符类?