From: Laszlo Tibor <ltibor@mail.tiszanet.hu>
To: Andre Schubert <andre.schubert@km3.de>
To: pgsql-sql@postgresql.org
Subject: Re: REFERENCES
Date: Wed, 13 Mar 2002 12:03:35 +0100
Message-ID: <NDELKOGEMPNIBNDBEANMOEDGCBAA.ltibor@mail.tiszanet.hu> (raw)
In-Reply-To: <3C8F2FA9.EF9C2710@km3.de>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: ltibor@mail.tiszanet.hu, andre.schubert@km3.de
Subject: Re: REFERENCES
In-Reply-To: <NDELKOGEMPNIBNDBEANMOEDGCBAA.ltibor@mail.tiszanet.hu>
References: <3C8F2FA9.EF9C2710@km3.de> <NDELKOGEMPNIBNDBEANMOEDGCBAA.ltibor@mail.tiszanet.hu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox