Nie wiem czy Cię zrozumiałem.
- Możesz użyć operatora CONTAINS dla tablic (@>)
- Możesz tablicę, hmm, "rozbić" (nie przychodzi mi do głowy lepsze polskie określenie na operację "unnest") na elementy i wybierać te rekordy, które zawierają w tablicy element spełniający warunek (drugie zapytanie)
create table foo ( id int, an_arr text[]);
insert into foo values (1,array['aaa','bbb','xy']);
insert into foo values (2,array['ccc','ddd','xy']);
insert into foo values (3,array['ccc','ddd','ab']);
insert into foo values (4,array['ccc','ddd','cd']);
select * from foo where an_arr @> array['xy'];
select id,foo from (
select id,foo,unnest(an_arr) elem from foo
) tmp where elem like 'dd%';
Ogólnie: https://www.postgresql.org/docs/current/functions-array.html