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 AB1059FA0EC for ; Thu, 6 Jul 2006 07:44:26 -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 50742-02 for ; Thu, 6 Jul 2006 07:44:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id BB7F19F94F3 for ; Thu, 6 Jul 2006 07:44:17 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1FyRSd-0004MR-IN for pgsql-sql@postgresql.org; Thu, 06 Jul 2006 06:51:55 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 026104172; Thu, 6 Jul 2006 06:44:06 -0400 (EDT) Date: Thu, 6 Jul 2006 06:44:06 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Alternative to serial primary key Message-ID: <20060706104406.GA26210@phlogiston.dyndns.org> References: <12b7ac1e0607060316ub7b5e21i5e8e3bef2504e02c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12b7ac1e0607060316ub7b5e21i5e8e3bef2504e02c@mail.gmail.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/54 X-Sequence-Number: 25628 On Thu, Jul 06, 2006 at 10:16:42PM +1200, David Clarke wrote: > column that is calculated from another column in the table but I think > it would still be more effective than a serial id. There is the problem that the hash is not proved unique (in fact, someone has generated collisions on md5). Primary keys have to be unique, of course. I _think_ with a hundred columns, you could probably prove (using brute force, if need be) that the hashes are going to be unique, assuming the list of possible values in each column is bounded. A -- Andrew Sullivan | ajs@crankycanuck.ca A certain description of men are for getting out of debt, yet are against all taxes for raising money to pay it off. --Alexander Hamilton