Skip site navigation (1) Skip section navigation (2)

Re: A generic question: Schema without foreign key specification?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Kumar S <ps_postgres(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: A generic question: Schema without foreign key specification?
Date: 2004-09-16 22:28:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

>  While designing 3-4 different schemas for my
> database, a question has been chasing me. I am not a
> CS graduate and I was never taught the nitty gritty's
> of Dabase schema or rules.

Me neither.  I learned the hard way, on the job.

> My question is - a schema that has no foreign key
> defined (except in 1 or 2 instances), will it be
> considered a good schema or bad schema by experts.

Bad, unless there's only 2 or 3 tables for your 1 or 2 joins.

> Imagine a scenario where most of the relations are
> defined by linker tables(relationship table) that is
> formed by two different primary keys from two
> different tables are defined to avoid foreign key
> relationships. creating a database in this kind of
> scenario, can it be considered a good database design.

But in that case you should have FKs from the linker tables.


Josh Berkus
Aglio Database Solutions
San Francisco

In response to

pgsql-novice by date

Next:From: Alexander JochumDate: 2004-09-17 09:30:11
Subject: Installation problem...
Previous:From: Jake StrideDate: 2004-09-16 22:09:51
Subject: Re: is there a sql command to display table definition?

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group