question about which column(s) are the right foreign key

From: Markus Bertheau <twanger(at)bluetwanger(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: question about which column(s) are the right foreign key
Date: 2004-06-20 21:22:13
Message-ID: 1087766532.2660.27.camel@teetnang
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)bluetwanger(dot)de>

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2004-06-20 22:15:39 Re: pivot-like transformation
Previous Message Torsten Lange 2004-06-20 19:44:11 pivot-like transformation