Thread: FW: Another array question: Join on array elements

FW: Another array question: Join on array elements

From
"elein"
Date:


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



Re: FW: Another array question: Join on array elements

From
KuroiNeko
Date:
> 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.

 Sounds  like a  repetition group  to  me. Repetition  groups are  strictly
prohibited in relational systems. Check your design.


--

 contaminated fish and microchips
  huge supertankers on Arabian trips
 oily propaganda from the leaders' lips
  all about the future
 there's people over here, people over there
  everybody's looking for a little more air
 crossing all the borders just to take their share
  planning for the future

 Rainbow, Difficult to Cure

RE: FW: Another array question: Join on array elements

From
"elein"
Date:
Thanks.  I know it is not normalized.
The question still stands.

--elein@nextbus.com

-----Original Message-----
From: pgsql-general-owner@hub.org [mailto:pgsql-general-owner@hub.org]On
Behalf Of KuroiNeko
Sent: Friday, October 27, 2000 9:38 PM
To: pgsql-general@hub.org
Subject: Re: [GENERAL] FW: Another array question: Join on array
elements


> 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.

 Sounds  like a  repetition group  to  me. Repetition  groups are  strictly
prohibited in relational systems. Check your design.


--

 contaminated fish and microchips
  huge supertankers on Arabian trips
 oily propaganda from the leaders' lips
  all about the future
 there's people over here, people over there
  everybody's looking for a little more air
 crossing all the borders just to take their share
  planning for the future

 Rainbow, Difficult to Cure