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 552E2D89AA for ; Tue, 6 Sep 2005 21:59:22 -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 35232-08 for ; Wed, 7 Sep 2005 00:59:16 +0000 (GMT) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by svr1.postgresql.org (Postfix) with ESMTP id AA8D5D8994 for ; Tue, 6 Sep 2005 21:59:17 -0300 (ADT) X-EthosMedia-Virus-Scanned: no infections found Received: from [64.81.245.111] (account josh@agliodbs.com HELO temoku.sf.agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 8049780; Tue, 06 Sep 2005 18:01:40 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Bob Ippolito Subject: Re: uuid type for postgres Date: Tue, 6 Sep 2005 18:02:50 -0700 User-Agent: KMail/1.8 Cc: jonah.harris@gmail.com, pgsql-hackers@postgresql.org, mark@mark.mielke.cc, nathan wagner References: <20050906135057.GA24136@granicus.if.org> <36e6829205090612575b954f38@mail.gmail.com> <3F60E55D-B558-4929-B614-C230EACFF473@redivi.com> In-Reply-To: <3F60E55D-B558-4929-B614-C230EACFF473@redivi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200509061802.51089.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.047 required=5 tests=[AWL=-0.003, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/299 X-Sequence-Number: 72696 Bob, People, Let me clarify my stance here, because it seems to be getting=20 misrepresented. Mark (and Nathan) pushed at repaired UUID type for possible inclusion in=20 the core PostgreSQL distribution. I'm not opposed to that, provided that=20 the portability, licensing, and bugs are worked out. Why not? We have=20 ipv6 data types, after all. However, Mark went on to suggest that we should recommend UUID over SERIAL= =20 in the docs, and that we could consider dropping SERIAL entirely in favor=20 of UUID: =2D--quoth Mark------------------ I suggest that UUID be recommended in place of SERIAL for certain classes of applications, and that it therefore belongs in the core. UUID and SERIAL can be used together (although, once you have a =C2=A0 UUID, it may not be useful to also have a SERIAL). =2D-------------------------------- This was what I objected to; I believe that the use-case for UUIDs is=20 actually quite narrow and assert that it's a very bad idea to promote them= =20 to most users. =20 I have a "problem" with SERIAL abuse, too. In general, new DB designers=20 have come to increasingly believe that surrogate keys (SERIALs, UUIDs,=20 hash ids etc.) are an intrinsic part of the relational model and a=20 requirement for all tables. Terrible database designs have resulted,=20 chock full of tables which lack real keys and cannot be normalized. UUIDs tend to encourage this sort of behavior even more than SERIALs, not=20 because of any intrinsic quality in the data type, but because much of the= =20 literature on the subject treats them like some kind of "universal object=20 identifier" and not distinguishing servers, relations, or real keys. =20 To repeat, though, this isn't a reason to keep them out of core, but it=20 *is* a reason not to throw them at newbies as the holy grail of row=20 identifiers. =46or my part, I generally push implementing the UUID concept in a better w= ay=20 that keeps server, table, and surrogate keys atomic (and thus more useful=20 and easier to debug). =2D-=20 =2D-Josh Josh Berkus Aglio Database Solutions San Francisco