我需要使用 btree_gist 来索引三个字段:postgis 几何图形、日期和 bigint。
我安装了 postgresql-contrib,并且可以使用以下命令毫无问题地创建扩展: CREATE EXTENSION btree_gist;
该扩展在 pgAdmin 的扩展列表中可见,但它不是根据psql中的命令\dx
安装。
显然,尝试使用 btree_gist 创建索引会导致错误,指出 btree_gist 不存在。
我正在运行 pqsl 9.5.4。 我有什么遗漏的吗?
最佳答案
根据手册 https://www.postgresql.org/docs/9.5/static/btree-gist.html
btree_gist provides GiST index operator classes that implement B-tree equivalent behavior for the data types int2, int4, int8, float4, float8, numeric, timestamp with time zone, timestamp without time zone, time with time zone, time without time zone, date, interval, oid, money, char, varchar, text, bytea, bit, varbit, macaddr, inet, and cidr.
这里不包括 PostGIS 几何图形,Postgis 几何图形也有自己的索引类型 GIST
这里有一个类似的问题 Postgres GIST vs Btree index
关于postgresql: btree_gist 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44397621/