Selecting rows by content of array type field - Mailing list pgsql-general

From mito
Subject Selecting rows by content of array type field
Date
Msg-id h612si$2fkq$1@news.hub.org
Whole thread Raw
Responses Re: Selecting rows by content of array type field
List pgsql-general
I have table like this:
CREATE TABLE messages {
    recepients varchar[],
};

Want to select by content co array type field recepients:
SELECT * FROM messages where 'john' ANY (recepients);

If i want to create index on recepients field, is it enough to

CREATE INDEX messages_recepients_index ON messages (recepients);

or is there other way how to index this? Expressions?

Thanks

pgsql-general by date:

Previous
From: kbarnard@kevinbarnard.net
Date:
Subject: Index utilization
Next
From: arsi@archie.netg.se
Date:
Subject: Encoding question when dumping/restoring databases for upgrade