Re: REFERENCES - Mailing list pgsql-sql

From Laszlo Tibor
Subject Re: REFERENCES
Date
Msg-id NDELKOGEMPNIBNDBEANMOEDGCBAA.ltibor@mail.tiszanet.hu
Whole thread Raw
In response to REFERENCES  (Andre Schubert <andre.schubert@km3.de>)
List pgsql-sql
On Wednesday, March 13, 2002 11:53 AM Behalf Of Andre Schubert wrote:

> Hi to all,
> 
> i have a simple problem and wont request assistance fro m this list.
> i have to tables
> 
> foo:
>         id int8 UNIQUE
> 
> bar:
>         id int8 UNIQUE
>         foo_id int8
> 
> Now i wont foo_id to be a id which exists in the foo, this could be done
> with foo_id REFERENCES foo (id).
> But what should i do if i want foo_id to be a id existing in foo or to
> be zero(0).
> I have created a view as "select id from foo UNION select 0" and tried
> to REFERENCE against this view, but that
> doesnt work.
> Can this problem be solved by a somebody ????
> 
> Thanks

Why do you want to use zeros? A foreign key could be NULL.


Regards, Tibor
ltibor@mail.tiszanet.hu



pgsql-sql by date:

Previous
From: Andre Schubert
Date:
Subject: REFERENCES
Next
From: Jean-Christophe FABRE
Date:
Subject: