Re: Strategy for Primary Key Generation When Populating Table - Mailing list pgsql-general

From Rich Shepard
Subject Re: Strategy for Primary Key Generation When Populating Table
Date
Msg-id alpine.LNX.2.00.1202090905170.5256@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: Strategy for Primary Key Generation When Populating Table  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: Strategy for Primary Key Generation When Populating Table
List 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



pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Strategy for Primary Key Generation When Populating Table
Next
From: Andy Colson
Date:
Subject: Re: Strategy for Primary Key Generation When Populating Table