fk problems with 0..n relations

From: "Luis Silva" <lfs12(at)hotmail(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: fk problems with 0..n relations
Date: 2005-12-05 11:18:42
Message-ID: BAY18-DAV31B9C8271FBE2993D634CB5410@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

>I just need to put MATCH SIMPLE in my fk, right??
>
>
> ----- Original Message -----
> From: "Bruno Wolff III" <bruno(at)wolff(dot)to>
> To: "Luis Silva" <lfs12(at)hotmail(dot)com>
> Cc: <pgsql-novice(at)postgresql(dot)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(at)hotmail(dot)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.
>>
>

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2005-12-05 16:46:11 Re: Need help building SQL query
Previous Message Robert Blixt 2005-12-05 09:28:04 Need help building SQL query