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

Array elem as foreign key?

From: "Gan Uesli Starling" <alias(at)starling(dot)us>
To: pgsql-novice(at)postgresql(dot)org
Subject: Array elem as foreign key?
Date: 2005-10-20 20:00:04
Message-ID: 20051020200004.2223.qmail@mail_102.selectedhosting.com (view raw or flat)
Thread:
Lists: pgsql-novice
Howdy, 

I have two tables, thus (sans non-relevent cols).... 

 -- Associate to a computer in the 'computers' table.
CREATE TABLE softwares (
 id SERIAL PRIMARY KEY,
 -- more cols after
); 

CREATE TABLE computers (
 --some cols before
 softwares INTEGER[10],
 --more cols after
);
COMMENT ON COLUMN computers.softwares IS '0th elem = OS. 1st-Nth = Any SW'; 

...and I'd like each elem of computers.sofwares
to reference softwares.id (or be NULL) but my
several attempts to date have been rejected. 

Is there a way to do this? If so, how? 

TIA, 

 --
Mistera Sturno - Rarest Extinct Bird 

<(+)__        Gan Uesli Starling
 ((__/)=-    Kalamazoo, MI, USA
  `||`
   ++        http://starling.us

Responses

pgsql-novice by date

Next:From: Galliker ArminDate: 2005-10-20 21:14:43
Subject: store images in a database?
Previous:From: Richard HuxtonDate: 2005-10-20 07:34:23
Subject: Re: SQL return value...

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