FW: Another array question: Join on array elements

Поиск
Список
Период
Сортировка
От elein
Тема FW: Another array question: Join on array elements
Дата
Msg-id NEBBICMNCLJIBNCCJFFMIEBACBAA.elein@norcov.com
обсуждение исходный текст
Список pgsql-general


Sorry to contribute to this list chaos, but I've got a question.
Yes, I know this is not normalized...

I have a table foo with key fookey.
I have a table bar which has as an attribute an array of fookeys called FK.
The number of elements in FK is variable.

I would like to:

select b.fookey, b.stuff
from foo f, bar b
where f.fookey in b.FK;

I could write a C function to turn FK into a text list, I suppose,
or create some cast of arrays to tables/set of rows.

Has anyone else already solved this problem without eliminating the
array?  Have I missed some reference somewhere to arrays as lists?

thanks

elein@nextbus.com



В списке pgsql-general по дате отправления:

Предыдущее
От: "Ben Souther"
Дата:
Сообщение: RE: Foreign key
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Selects in server side functions