Re: Strategy for Primary Key Generation When Populating Table

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Strategy for Primary Key Generation When Populating Table
Дата
Msg-id CAHyXU0yoW5CsCD4wY+9WKoDiQiVksEZFtPWgNpTTuerQ4tB4ow@mail.gmail.com
обсуждение исходный текст
Ответ на Strategy for Primary Key Generation When Populating Table  (Rich Shepard <rshepard@appl-ecosys.com>)
Ответы Re: Strategy for Primary Key Generation When Populating Table  (Rich Shepard <rshepard@appl-ecosys.com>)
Список 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 по дате отправления:

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Strategy for Primary Key Generation When Populating Table
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Strategy for Primary Key Generation When Populating Table