Am I supposed to be all scared of compound primary keys? - Mailing list pgsql-general

From Mike Christensen
Subject Am I supposed to be all scared of compound primary keys?
Date
Msg-id x2u7aa638e01005011925hf807ccbg1ae7838e943be5c1@mail.gmail.com
Whole thread Raw
Responses Re: Am I supposed to be all scared of compound primary keys?  (Scott Marlowe <scott.marlowe@gmail.com>)
Re: Am I supposed to be all scared of compound primary keys?  (Christophe Pettus <xof@thebuild.com>)
List pgsql-general
I have a table that stores a user ID and a subscription type, and this is really all it needs to store and any pair of values will always be unique.  In fact, I think this pair should be the primary key on the table.  However, I'm using Castle ActiveRecord which says at:

http://www.castleproject.org/activerecord/documentation/v1rc1/usersguide/pks.html#CompositePK

And I quote:

Quick Note: Composite keys are highly discouraged. Use only when you have no other alternative.

I get the feeling they're discouraged from a SQL point of view, but it doesn't actually say why anywhere.  Is there any good reason to avoid using composite keys on a table?  Why waste the space of an extra key if you don't have to?  Thanks!

Mike

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: PostgreSQL vs. Microsoft SQL server
Next
From: Scott Marlowe
Date:
Subject: Re: Am I supposed to be all scared of compound primary keys?