At 08:20 AM 9/18/2008, [EMAIL PROTECTED] wrote:
Message-ID: <[EMAIL PROTECTED]>
Date: Wed, 17 Sep 2008 09:20:44 -0700
From: "Richard Broersma" <[EMAIL PROTECTED]>
To: "Scott Marlowe" <[EMAIL PROTECTED]>
Subject: Re: surrogate vs natural primary keys
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
X-Archive-Number: 200809/124
X-Sequence-Number: 31576


My opinion is that the database constraints are the last line of
defense to ensure business rules and data integrity are not violated.
Since I highly value the ability to enforce business rules using
ordinary table DDL, I try to use natural keys as often as I can.


Hi Richard,

I often find your comments insightful and right on the money. This is another one of those cases. Your comments above are a great example of when natural keys make sense: I hadn't looked at it from this perspective!

I'm a middleware developer (the bane of DBA's!) -- and so I generally "solve" these sorts business rules constraints in the middleware code, which of course is prone to all kinds of different problems (like lazy developers who code around the OO validation checkers!).

Thanks for giving such a great explanation as to the value of natural keys! You haven't won me over, but you did teach me something - which I appreciate.

Best,

Steve


--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to