Received: from server.beierfeld.kabeljournal.de (pD9508749.dip.t-dialin.net [217.80.135.73]) by postgresql.org (Postfix) with SMTP id B36394758F1 for ; Wed, 13 Mar 2002 07:17:20 -0500 (EST) Received: (qmail 3002 invoked from network); 13 Mar 2002 12:17:22 -0000 Received: from station158.beierfeld.kabeljournal.de (HELO km3.de) (192.168.128.158) by server.beierfeld.kabeljournal.de with SMTP; 13 Mar 2002 12:17:22 -0000 Message-ID: <3C8F43E3.80CC03BF@km3.de> Date: Wed, 13 Mar 2002 13:19:47 +0100 From: Andre Schubert X-Mailer: Mozilla 4.77 [de] (X11; U; Linux 2.2.19-6.2.12 i586) X-Accept-Language: en MIME-Version: 1.0 To: Laszlo Tibor Cc: pgsql-sql@postgresql.org Subject: Re: REFERENCES References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/135 X-Sequence-Number: 7015 Laszlo Tibor schrieb: > > 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. Yes I know, but i need these Zeroes..... Thanks > > Regards, Tibor > ltibor@mail.tiszanet.hu > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly