Re: Strategy for Primary Key Generation When Populating Table

From: Vincent Veyron <vv(dot)lists(at)wanadoo(dot)fr>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Strategy for Primary Key Generation When Populating Table
Date: 2012-02-10 19:56:24
Message-ID: 1328903784.2537.23.camel@asus-1001PX.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 also create 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Blackwell 2012-02-10 20:16:50 9.1.1 crash
Previous Message Tom Lane 2012-02-10 19:54:27 Re: [GENERAL] pg_dump -s dumps data?!