X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5296CD7DC7 for ; Wed, 7 Sep 2005 13:47:00 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 84296-02 for ; Wed, 7 Sep 2005 16:46:57 +0000 (GMT) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by svr1.postgresql.org (Postfix) with ESMTP id 67400D7D0D for ; Wed, 7 Sep 2005 13:46:57 -0300 (ADT) X-EthosMedia-Virus-Scanned: no infections found Received: from [63.195.55.98] (account josh@agliodbs.com HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 8053405; Wed, 07 Sep 2005 09:49:17 -0700 From: Josh Berkus Organization: Aglio Database Solutions To: pgsql-hackers@postgresql.org Subject: Re: uuid type for postgres Date: Wed, 7 Sep 2005 09:48:08 -0700 User-Agent: KMail/1.8 Cc: nathan wagner References: <20050906135057.GA24136@granicus.if.org> <200509061840.28068.josh@agliodbs.com> <20050907023606.GA2181@granicus.if.org> In-Reply-To: <20050907023606.GA2181@granicus.if.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509070948.08307.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.011 required=5 tests=[AWL=0.011] X-Spam-Level: X-Archive-Number: 200509/330 X-Sequence-Number: 72727 Nathan, > Take a look at the version 3 or version 5 UUIDs. They essentially do this. > The hash isn't reversable, but rather recreatable. Seems that if it > were reversable, it would be compression, not a hash. Anyway. Hmmm, yes, true. > You're assuming though that you want to leak this information. If you do, > or you don't care, go ahead with the v3 or v5 uuid creator. > > Or use v1 if you want mac/time based uuids, or v4 for random uuids. > > The convenient thing about using the uuid library is that all of these > mechanisms result in the same type, and are thus compatible. That's good, it gives users options. And I can see why you don't want to re-create the functionality in PG code, it's probably pretty large. > > I've never understood the complex measures which > > application developers take to create "universal" IDs. > > Different applications have different goals. Unguessability might > be important in some contexts. Well, IMHO, if the unguessability of UUIDs is an important part of your spec, you have some design problems. But it's not my job to lock up the foot-guns, just to make sure they come with warnings ... -- Josh Berkus Aglio Database Solutions San Francisco