Re: Alternative to serial primary key

Поиск
Список
Период
Сортировка
От D'Arcy J.M. Cain
Тема Re: Alternative to serial primary key
Дата
Msg-id 20060707073325.926f601f.darcy@druid.net
обсуждение исходный текст
Ответ на Re: Alternative to serial primary key  ("David Clarke" <pigwin32@gmail.com>)
Ответы Re: Alternative to serial primary key
Re: Alternative to serial primary key
Список pgsql-sql
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.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: Alternative to serial primary key
Следующее
От: Gary Stainburn
Дата:
Сообщение: Re: Update from join