在Postgresql 9.3 Beta 2(?)中,如何在JSON字段上创建索引?我尝试使用 – >运算符用于hstore但得到以下错误:
CREATE TABLE publishers(id INT,info JSON); CREATE INDEX ON publishers((info->'name'));
ERROR: data type json has no default operator class for access method
“btree” HINT: You must specify an operator class for the index or
define a default operator class for the data type.
发现:
原文链接:https://www.f2er.com/postgresql/193797.htmlCREATE TABLE publishers(id INT,info JSON); CREATE INDEX ON publishers((info->>'name'));