From: Markus Bertheau <twanger@bluetwanger.de>
To: pgsql-sql@postgresql.org
Subject: question about which column(s) are the right foreign key
Date: Sun, 20 Jun 2004 23:22:13 +0200
Message-ID: <1087766532.2660.27.camel@teetnang> (raw)
Hi,
I have objects in my database, and they have an object id generated with
a sequence. Then I have object versions. The ids of object versions need
to be unique only within one object id. But for simplicity they're
generated with a sequence, too.
Now I want to reference an object version. I can use just the object
version id, because it "happens" to be globally unique. Conceptually
though, I should use the object's id and its version's id.
Now redundancy is Not Good™, so I wonder which way is the Right One™.
I understand that both ways work and that the variant with just the
object id is probably both faster and smaller.
I'd be thankful for enlightenment :)
--
Markus Bertheau <twanger@bluetwanger.de>
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: twanger@bluetwanger.de
Subject: Re: question about which column(s) are the right foreign key
In-Reply-To: <1087766532.2660.27.camel@teetnang>
* 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