Re: Advice on index and constraint definition - Mailing list pgsql-novice

From David G Johnston
Subject Re: Advice on index and constraint definition
Date
Msg-id 1411264502294-5819815.post@n5.nabble.com
Whole thread Raw
In response to Re: Advice on index and constraint definition  (JORGE MALDONADO <jorgemal1960@gmail.com>)
List pgsql-novice
JORGE MALDONADO wrote
> Thanks for your answer. I am a DB novice and I still have questions, I
> would like you to explain a bit more about the following:
>
> " I'd generally question a design that uses 5 foreign keys on a matching
> table"
>
> Does this mean that my table with 5 foreign keys should have fewer foreign
> keys? How could I achieve this goal if such a table depends on 5 other
> tables? Maybe a must take into account a redesign of this precise table.

My point is a single table relating five other individual tables is quite
probably not properly normalized.  If you are using multi-column primary
keys then the presence of 5 columns might only represent 2 source tables
which would be more 'normal'.

This kind of table typically is used for a direct many-to-many relationship
so having 5 foreign keys would definitely complicate the logic.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Advice-on-index-and-constraint-definition-tp5819799p5819815.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


pgsql-novice by date:

Previous
From: JORGE MALDONADO
Date:
Subject: Re: Advice on index and constraint definition
Next
From: Kevin Struckhoff
Date:
Subject: Unable to connect remotely to postgres server