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

From Merlin Moncure
Subject Re: Strategy for Primary Key Generation When Populating Table
Date
Msg-id CAHyXU0yoW5CsCD4wY+9WKoDiQiVksEZFtPWgNpTTuerQ4tB4ow@mail.gmail.com
Whole thread Raw
In response to Strategy for Primary Key Generation When Populating Table  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: Strategy for Primary Key Generation When Populating Table
List pgsql-general
On Thu, Feb 9, 2012 at 10:49 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:
>  I have a lot of data currently in .pdf files. I can extract the relevant
> data to plain text and format it to create a large text file of "INSERT INTO
> ..." rows. I need a unique ID for each row and there are no columns that
> would make a natural key so the serial data type would be appropriate.

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

pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Strategy for Primary Key Generation When Populating Table
Next
From: Rich Shepard
Date:
Subject: Re: Strategy for Primary Key Generation When Populating Table