在 PostgreSQL 9.2.3 我试图创建这个简化的表:
CREATE TABLE test (
user_id INTEGER,
startend TSTZRANGE,
EXCLUDE USING gist (user_id WITH =, startend WITH &&)
);
Run Code Online (Sandbox Code Playgroud)
但我收到此错误:
Run Code Online (Sandbox Code Playgroud)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.
在PostgreSQL的文档使用这个例子不为我工作:
CREATE TABLE room_reservation (
room text,
during tsrange,
EXCLUDE USING gist (room WITH =, during WITH &&)
);
Run Code Online (Sandbox Code Playgroud)
同样的错误信息。
而这个对我来说也不起作用: …
postgresql constraint installation exclusion-constraint gist-index