From: chester c young <chestercyoung@yahoo.com>
To: Ryan <pgsql-sql@seahat.com>
Cc: sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: N all-way relationship
Date: Tue, 13 May 2003 09:33:16 -0700 (PDT)
Message-ID: <20030513163316.11749.qmail@web12708.mail.yahoo.com> (raw)
In-Reply-To: <11523.65.102.128.233.1052835391.squirrel@fordparts.com>
--- Ryan <pgsql-sql@seahat.com> wrote:
> This is largely related to cross referencing part numbers
Why not
table master_part(
part_id int primary key,
part_no not null unique,
... );
table vendor( vendor_no primary key, ... );
table vendor_part(
part_id int primary key default(seq),
vendor_no references vendor,
master_part references master_part( part_id ),
vendor_part,
constraint unique( vendor_no, vendor_part ),
... );
Everything here is nice and normal (use part_id to avoid compound
primary keys). Then use views for all cross referencing.
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: chestercyoung@yahoo.com, pgsql-sql@seahat.com
Subject: Re: N all-way relationship
In-Reply-To: <20030513163316.11749.qmail@web12708.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox