Re: Strategy for Primary Key Generation When Populating Table

Поиск
Список
Период
Сортировка
От Vincent Veyron
Тема Re: Strategy for Primary Key Generation When Populating Table
Дата
Msg-id 1328888975.2537.12.camel@asus-1001PX.home
обсуждение исходный текст
Ответ на Re: Strategy for Primary Key Generation When Populating Table  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: Strategy for Primary Key Generation When Populating Table
Re: Strategy for Primary Key Generation When Populating Table
Список pgsql-general
Le jeudi 09 février 2012 à 16:30 -0600, Merlin Moncure a écrit :

> natural/surrogate is a performance/usability debate with various
> tradeoffs.  but using surrogate to 'create' uniqueness is a logical
> design error; maybe a very forgivable one for various reasons, but the
> point stands.

Please consider the following case :

I record insurance claims in the table below, where id_evenement,
id_agent and date_origine define a unique event.

However, records sometimes have to be canceled (set annule=true), and
re-recorded the same way. They're normally canceled once, but
occasionnally twice, or more (for various reasons).

What would you use for a primary key?

CREATE TABLE tbldossier (
    id_evenement text NOT NULL,
    id_agent integer NOT NULL,
    date_origine date NOT NULL,
    annule boolean DEFAULT false NOT NULL);


--
Vincent Veyron
http://marica.fr/
Logiciel de gestion des sinistres et des contentieux pour le service juridique


В списке pgsql-general по дате отправления:

Предыдущее
От: Venkat Balaji
Дата:
Сообщение: Re: [GENERA]: Postgresql-9.1.1 synchronous replication issue
Следующее
От: kenkyee@yahoo.com
Дата:
Сообщение: anyone use pg_rman successfully w/ Postgresql 9.1 64-bit?