Re: Alternative to serial primary key - Mailing list pgsql-sql

From David Clarke
Subject Re: Alternative to serial primary key
Date
Msg-id 12b7ac1e0607070037p4c2a94d4r8e6758be7b08ca95@mail.gmail.com
Whole thread Raw
In response to Re: Alternative to serial primary key  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Responses Re: Alternative to serial primary key  ("D'Arcy J.M. Cain" <darcy@druid.net>)
List pgsql-sql
On 7/7/06, D'Arcy J.M. Cain <darcy@druid.net> wrote:
> Are you sure?  I have a hard time imagining a situation where that
Absolutely.

> Also, you need to get into a lot more coding to handle the fact that
> "521 Main Avenue" is the same address as "521 Main Av." and "521 Main
> Ave" and even "521 Main."
Actually that is being done for me and you're correct, it is a lot of
effort but there are a variety of services out there and I'm not
trying to reinvent the wheel.

> And even given all of that, I would probably still use serial.
Because?

> 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.

Dave


pgsql-sql by date:

Previous
From: "Phillip Smith"
Date:
Subject: Select Maths
Next
From: "David Clarke"
Date:
Subject: Re: Alternative to serial primary key