Re: Strategy for Primary Key Generation When Populating Table

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Strategy for Primary Key Generation When Populating Table
Date: 2012-02-09 17:08:57
Message-ID: alpine.LNX.2.00.1202090905170.5256@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 9 Feb 2012, Merlin Moncure wrote:

> The record should be logically unique as well as physically unique (of if
> it isn't, why bother making a unique constraint at all?). Sometimes you
> *have* to force a surrogate, for example if certain (broken) client tools
> need a primary key to work, but aside from that you shouldn't rely on a
> surrogate to generate uniqueness.

merlin,

I have reports containing macroinvertebrate collection data for several
hundred (or several thousand) of taxa. There is no natural key since there
are multiple rows for each site/date pair. Years ago Joe Celko taught me to
seek natural keys whenever they might exist. They don't here. That's why I
specifically mentioned that in my message.

The only 'broken client tools' are their consistent uses of Microsoft
Excel to store data or providing text reports in pdf with other data.

Rich

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2012-02-09 17:10:18 Re: Strategy for Primary Key Generation When Populating Table
Previous Message Merlin Moncure 2012-02-09 17:01:58 Re: Strategy for Primary Key Generation When Populating Table