Skip site navigation (1) Skip section navigation (2)

FW: Another array question: Join on array elements

From: "elein" <elein(at)norcov(dot)com>
To: <pgsql-general(at)hub(dot)org>
Cc: "elein" <elein(at)norcov(dot)com>
Subject: FW: Another array question: Join on array elements
Date: 2000-10-28 02:02:09
Message-ID: NEBBICMNCLJIBNCCJFFMIEBACBAA.elein@norcov.com (view raw or flat)
Thread:
Lists: 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(at)nextbus(dot)com



Responses

pgsql-general by date

Next:From: Tom LaneDate: 2000-10-28 02:42:30
Subject: Re: Selects in server side functions
Previous:From: The Hermit HackerDate: 2000-10-28 01:59:04
Subject: Re: 7.1 release date ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group