Re: PostgreSQL Developer Best Practices

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Rob Sargent <robjsargent(at)gmail(dot)com>, Melvin Davidson <melvin6925(at)gmail(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL Developer Best Practices
Date: 2015-08-25 16:38:44
Message-ID: 55DC9A14.9040208@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/25/2015 09:09 AM, Rob Sargent wrote:
> On 08/25/2015 09:40 AM, Melvin Davidson wrote:
>> Adrian,
>>
>> Stop being so technical. When we/I speak of natural keys, we are
>> talking about the column
>> that would NATURALly lend itself as the primary key.
>> No one ever said a number is not natural. just that there is no need
>> to duplicate uniqueness
>> with a separate number.
>>
>> IOW: If we have an account table, then the account_id or account_no
>> would be the primary key. There is no need to have a separate
>> serial id as the primary key.
> If I'm following correctly, you're saying that if the definition of the
> entity contains and arbitrary unique value then use that. Fine. I guess
> I quibble with the notion of VIN as a "natural" attribute of car. (I
> have no firsthand experience with VINs but I would bet there's
> information tucked inside them, which would make me sceptical of using
> them :) )
>

But a VIN is in fact, UNIQUE so it is useful as a PK.

JD

--
Command Prompt, Inc. - http://www.commandprompt.com/ 503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Announcing "I'm offended" is basically telling the world you can't
control your own emotions, so everyone else should do it for you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2015-08-25 16:44:08 Re: PostgreSQL Developer Best Practices
Previous Message Marc Munro 2015-08-25 16:33:28 PostgreSQL Developer Best Practices