Re: Surrogate primary key plus unique constraint vs. natural primary key: data integrity?

From: Jan Hidders <hidders_at_gmail.com>
Date: Thu, 14 Mar 2013 00:38:36 +0100
Message-ID: <51410dfc$0$604$e4fe514c_at_dreader34.news.xs4all.nl>


On 2013-03-13 10:37:00 +0000, robur.6_at_gmail.com said:

> On Tuesday, March 12, 2013 9:22:38 PM UTC+2, Jan Hidders wrote:

>> 
>> Is it? I'm agnostic on the issue myself, and I would never use that 
>> exact argument. Rather I would claim that in general the approach tends 
>> to reduce their number, which is true.
>> 

>
> Application programmers usually invoke this argument, they find it
> easier to deal with an integer key column. Also many ORMs and
> frameworks do not support composite keys. And actually I’ve seen many
> programmers that didn’t heard about composite keys, I’ve even been
> asked once by a PM why I did not added a primary key on a table. It
> took me a while to realize that by primary key he was meaning a
> surrogate.

Sure. But that does not mean that all arguments in favor of surrogate identifiers are therefore complete nonsense, even if most of the people that favor them tend to be crappy data modelers with a weak grasp of the importance of having proper integrity constraints. :-) I'd like to see a bit more precise analysis on when and why they are a problem, rathern then a naive sweeping generalization that declarese them as always evil.

  • Jan Hidders
Received on Thu Mar 14 2013 - 00:38:36 CET

Original text of this message