Re: REFERENCES

From: Andre Schubert <andre(dot)schubert(at)km3(dot)de>
To: Laszlo Tibor <ltibor(at)mail(dot)tiszanet(dot)hu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: REFERENCES
Date: 2002-03-13 12:19:47
Message-ID: 3C8F43E3.80CC03BF@km3.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)mail(dot)tiszanet(dot)hu
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-03-13 15:08:14 Re: Large data sets and FOR LOOP's
Previous Message Dino Cherian K 2002-03-13 11:43:58 [INIMSS] How to use OID?