pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: D'Arcy J.M. Cain <darcy@druid.net>
To: David Clarke <pigwin32@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Alternative to serial primary key
Date: Fri, 7 Jul 2006 07:33:25 -0400
Message-ID: <20060707073325.926f601f.darcy@druid.net> (raw)
In-Reply-To: <12b7ac1e0607070037p4c2a94d4r8e6758be7b08ca95@mail.gmail.com>
References: <bf05e51c0607060902vdd8d993u470c128abf127d3d@mail.gmail.com>
	<20060706183920.46008.qmail@web33314.mail.mud.yahoo.com>
	<12b7ac1e0607061330o34adbd6ds9bd624d3889c7fe7@mail.gmail.com>
	<20060706171816.9f248316.darcy@druid.net>
	<12b7ac1e0607070037p4c2a94d4r8e6758be7b08ca95@mail.gmail.com>

On Fri, 7 Jul 2006 19:37:15 +1200
"David Clarke" <pigwin32@gmail.com> wrote:
> > And even given all of that, I would probably still use serial.
> Because?

Simplicity.  Cleanliness.

> > Danger, Will Robinson.  The phrase "regenerate my primary key"
> > immediately raises the hairs on the back of my neck.  If the primary
> > key can ever change, you have a broken schema.
> 
> Perhaps my choice of words was somewhat hasty. A serial is totally
> divorced from the data it represents whereas a md5 hash is (for my
> purposes) unique, stable, verifiable, and simple.

It's not that I think that the primary key should never have meaning in
the database (I use the two letter country code as the PK in my country
table for example) I just think that it's dangerous ground and should
be tread very carefully.

However, I join others in applauding you for your efforts to investigate
this so deeply.  You may wind up coming out of this with something
interesting, even if it isn't what you went in looking for.

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



view thread (34+ messages)  latest in thread

Message-ID: <20060707073325.926f601f.darcy@druid.net>
Permalink:  ../20060707073325.926f601f.darcy@druid.net/
Also on:    postgresql.org/message-id/20060707073325.926f601f.darcy@druid.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: darcy@druid.net, pigwin32@gmail.com
  Subject: Re: Alternative to serial primary key
  In-Reply-To: <20060707073325.926f601f.darcy@druid.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox