Unix Technical Forum

fk problems with 0..n relations

This is a discussion on fk problems with 0..n relations within the pgsql Novice forums, part of the PostgreSQL category; --> >I just need to put MATCH SIMPLE in my fk, right?? > > > ----- Original Message ----- > ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 10:20 PM
Luis Silva
 
Posts: n/a
Default fk problems with 0..n relations




>I just need to put MATCH SIMPLE in my fk, right??
>
>
> ----- Original Message -----
> From: "Bruno Wolff III" <bruno@wolff.to>
> To: "Luis Silva" <lfs12@hotmail.com>
> Cc: <pgsql-novice@postgresql.org>
> Sent: Monday, December 05, 2005 4:55 AM
> Subject: Re: fk problems with 0..n relations
>
>
>> On Mon, Dec 05, 2005 at 01:45:37 -0000,
>> Luis Silva <lfs12@hotmail.com> wrote:
>>> I there, i'm having a problem. i have a table(1) that is connected with
>>> two multiple table (2 and 3). the problem is that the table 1 might have
>>> one of the tables (2 or 3, or both). how can i make this relationship in
>>> sql. Resuming, table 1 as a 0..n relation with table 2 and 3. thanks in
>>> advance.

>>
>> Normally you just have tables 2 and 3 refer to table 1 and not the other
>> way
>> around.
>>
>> If you need to make sure that the entry in table 1 corresponds to at
>> least
>> one entry in table 2 or table 3, then you can have table 1 refer to both
>> table 2 and table 3, but allow nulls. Then you use a constraint to make
>> sure at least one of the references is not null.
>>

>


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:52 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com