我正在尝试在 Postgres 9.6 数据库中添加一个包含 UUID 的 GIN 索引。从技术上讲,它是一个复合索引,复合 GIN 支持来自 btree_gin 插件。
我尝试用以下语句创建索引:
CREATE EXTENSION btree_gin;
CREATE INDEX ix_tsv ON text_information USING GIN (client_id, text_search_vector);
Run Code Online (Sandbox Code Playgroud)
但我收到此错误:
Run Code Online (Sandbox Code Playgroud)ERROR: data type uuid has no default operator class for access method "gin" HINT: You must specify an operator class for the index or define a default operator class for the data type.
client_id是数据类型uuid并且text_search_vector是tsvector. 我认为复合/btree_gin 因素实际上并不相关,因为我尝试单独创建索引时遇到相同的错误client_id,但希望如果有解决方案,它也可以与复合索引一起使用。
我在 uuid 数组上找到了 PostgreSQL GIN 索引,这似乎表明它应该是可能的(如果可以完成 UUID …