Обсуждение: arrays and subselects

Поиск
Список
Период
Сортировка

arrays and subselects

От
Dave Hollenbeck
Дата:
Hello all,

I'm trying to make use of PostgreSQL's array capability with very limited
success.

Is is possible to use the result of a "select arraycol" as a subquery
of the form "select foo from bar where col in (select arraycol from blah..."?

That seems to me to be an ideal use of the array type, but I haven't found
the magic incantation to make it work.  Am I totally missing the picture?

I'd also expect "select foo from bar where col in (select col1,col2,col3.."
to work, where the subquery is guaranteed to return N columns from a single
row.  Again, I feel like I must be missing something basic here (as in,
some sort of theoretical understanding of why this should or shouldn't
work).

Thanks for any tips or pointers.

Regards,
Dave