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

From Vincent Veyron
Subject Re: Strategy for Primary Key Generation When Populating Table
Date
Msg-id 1328903784.2537.23.camel@asus-1001PX.home
Whole thread Raw
In response to Re: Strategy for Primary Key Generation When Populating Table  (David Johnston <polobo@yahoo.com>)
Responses Re: Strategy for Primary Key Generation When Populating Table
List pgsql-general
Le vendredi 10 février 2012 à 14:19 -0500, David Johnston a écrit :

> One possibility is to add a "version" field (integer) and combine evenement and version to create the unique.  I'd
alsocreate a partial unique on evenement/annule to ensure you do not make more than one active version. 
>

Hi David,


I don't find this solution very much different from using a surrogate
key?

Except that you then have to code it yourself, instead of using the
built-in serial.

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


pgsql-general by date:

Previous
From: Steve Clark
Date:
Subject: Re: " " around fields with psql
Next
From: Mike Blackwell
Date:
Subject: 9.1.1 crash