Re: Surrogate primary key plus unique constraint vs. natural primary key: data integrity?
Date: Fri, 08 Mar 2013 20:37:07 +0100
Message-ID: <khdeia$i56$1_at_dont-email.me>
Hi Wolfgang,
your concerns seem to have a contradiction:
> I've always been used to using exclusively natural (comosite) primary
> keys, to warrant data integrity. Now computer science people (I'm just
> an engineer) keep telling me that concerning data integrity, it would be
> absolutely equivalent to use a surrogate primary key together with a
> unique constraint on the natural key.
Note that they say "absolutely equivalent". Though I have never heard of a "relative equivalence" this means that what applies to A applies to B and vice versa.
> Or could anyone give an example where the approach of using a surrogate
> primary key together with a unique constraint on the natural key would
> "break" data integrity (especially referential integrity) which could be
> avoided by using a natural (composite) primary key?
When the approaches are, in fact, equivalent such an example cannot exist.
Hope that helped.
Norbert
an engineer, too :)
Received on Fri Mar 08 2013 - 20:37:07 CET