Re: question on serial key

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: question on serial key
Date: 2009-05-22 14:33:34
Message-ID: 20090522143334.GC5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Keith Hayden 2009-05-22 14:35:39 How to update stavaluesN columns in pg_statistics (type anyarry)
Previous Message Roderick A. Anderson 2009-05-22 14:26:35 Re: question on serial key