我想在特定类型的元素中创建索引。
你能帮帮我吗?感谢CREATE TYPE taddress AS (
street1 varchar,
street2 varchar,
zipcode varchar,
city varchar
);
CREATE TABLE person (
id serial primary key,
firstname varchar not null,
lastname varchar not null,
address taddress);
CREATE INDEX idx_street1 ON person ((address).street2); -- <- Doesn't work !!
答案 0 :(得分:1)
请试试这个:
CREATE INDEX idx_street1 ON person (((address).street2));
如果这不适合您,请提供完整的错误消息。