Re: question on serial key - Mailing list pgsql-general

From Sam Mason
Subject Re: question on serial key
Date
Msg-id 20090522143334.GC5407@samason.me.uk
Whole thread Raw
In response to question on serial key  (Brandon Metcalf <brandon@geronimoalloys.com>)
Responses Re: question on serial key
Re: question on serial key
List pgsql-general
On Fri, May 22, 2009 at 08:41:46AM -0500, Brandon Metcalf wrote:
> I am looking for criteria on deciding whether or not to use a serial
> (auto-incrementing) key for rows in a table.

Wow, that's the second time today someone asked that!

> Intuitively, it's pretty clear to me when a serial index is called
> for.  Is there a succinct set of guidelines that one could go by?

Not that I'm aware of; it's a fuzzy design choice with benefits and
costs for either option.  There are lots of people who arbitrarily
pick one side which tends to make things worse, using one or the other
*exclusively* will add complication.  General terms to search for are
Natural keys vs. Surrogate keys.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: question on serial key
Next
From: "Roderick A. Anderson"
Date:
Subject: Re: question on serial key