3

我想在特定类型的元素中创建索引。

你能帮助我吗 ?谢谢

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 !! 
4

1 回答 1

1

请试试这个:

CREATE INDEX idx_street1 ON person (((address).street2));

如果这对您不起作用,请包含完整的错误消息。

于 2012-07-04T08:09:10.873 回答