X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2BEB19FB25A for ; Fri, 7 Jul 2006 12:04:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 17946-05 for ; Fri, 7 Jul 2006 12:04:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id C53899FB1F0 for ; Fri, 7 Jul 2006 12:04:08 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 8178530B9A; Fri, 7 Jul 2006 17:04:07 +0200 (MET DST) From: Chris Browne X-Newsgroups: pgsql.sql Subject: Re: Alternative to serial primary key Date: Fri, 07 Jul 2006 10:33:48 -0400 Organization: cbbrowne Computing Inc Lines: 23 Message-ID: <60zmflscvn.fsf@dba2.int.libertyrms.com> References: <20060706183920.46008.qmail@web33314.mail.mud.yahoo.com> <12b7ac1e0607061330o34adbd6ds9bd624d3889c7fe7@mail.gmail.com> <20060706171816.9f248316.darcy@druid.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.19 (linux) Cancel-Lock: sha1:kZLATrtgVcDkYUuL/lMrrjtO5w8= To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/102 X-Sequence-Number: 25676 darcy@druid.net ("D'Arcy J.M. Cain") writes: > And even given all of that, I would probably still use serial. >> and has been recommended. But having a hash function over the address >> column as the primary key means I can always regenerate my primary key > > 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. Actually, I'd call it worse than that... A schema is "merely" a technical detail. The trouble is that if the primary key can ever change, then you have a broken model for the data. You can do "technical things" to fix problems with a schema; if the data model is busted, then your schema is necessarily broken, in a way that cannot be fixed. -- (format nil "~S@~S" "cbbrowne" "ntlug.org") http://cbbrowne.com/info/unix.html MICROS~1 is to quality software what MacDonalds is to gourmet cooking