Re: Alternative to serial primary key

From: "David Clarke" <pigwin32(at)gmail(dot)com>
To: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
Cc: operationsengineer1(at)yahoo(dot)com, postgresql(at)aranya(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: Alternative to serial primary key
Date: 2006-07-07 07:37:15
Message-ID: 12b7ac1e0607070037p4c2a94d4r8e6758be7b08ca95@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 7/7/06, D'Arcy J.M. Cain <darcy(at)druid(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Clarke 2006-07-07 08:07:11 Re: Alternative to serial primary key
Previous Message Phillip Smith 2006-07-07 06:53:52 Select Maths