X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 21D3B9FAC76 for ; Mon, 26 Jun 2006 21:15:44 -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 46270-10 for ; Mon, 26 Jun 2006 21:15:34 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by postgresql.org (Postfix) with ESMTP id 5F4D09FABE7 for ; Mon, 26 Jun 2006 21:15:33 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id a2so2321991ugf for ; Mon, 26 Jun 2006 17:15:32 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=fnFj0cWhTk4fN3C9cm2+NEvrGZaN7VjDSEivi+BG8XVkzlEST7DAMAS64z/pNFeRMMzyoqa0VCKKBcwm2AShxWgcze6/ad7jQLUURnZhKU3F74FNYRVMmatT8HCSuStyoZjeMaJGGYG7joh9eI4yINTGRMracj2iZqeDiSbx3Ps= Received: by 10.78.167.12 with SMTP id p12mr2326368hue; Mon, 26 Jun 2006 17:15:32 -0700 (PDT) Received: by 10.78.29.2 with HTTP; Mon, 26 Jun 2006 17:15:32 -0700 (PDT) Message-ID: Date: Mon, 26 Jun 2006 19:15:32 -0500 From: "Aaron Bono" To: "Dennis Wagner" Subject: Re: Using GUIDs Cc: pgsql-admin@postgresql.org In-Reply-To: <449FE9AD.7010400@Spheron.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10581_20253078.1151367332080" References: <449FE9AD.7010400@Spheron.com> X-Google-Sender-Auth: 78cef44fe2cbbfee X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/248 X-Sequence-Number: 22210 ------=_Part_10581_20253078.1151367332080 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline By its definition, GUID ( http://en.wikipedia.org/wiki/GUID ) is not guaranteed to be unique. As a result, it could cause problems in tables that have a large number of rows - actually this could result in hard to reproduce, seemingly random errors in your systems that use the database. How does a GUID help you over a BIGSERIAL? Unless you are generating the PK in multiple databases, a BIGSERIAL should act as a UUID. Maybe if you provide a little more detail on why you want to use GUID or UUID fields we can help you come up with more options. Thanks, Aaron On 6/26/06, Dennis Wagner wrote: > > Hi list! > > I'm currently thinking about using GUIDs as primary keys. To be more > precise: On *some* of the tables in my structure I *will* need GUIDs (or > UUIDs or whatever format may proove usefull). Now, this implies that > using a bigserial-field for readability and the uids is redundand, so > I'm thinking of dropping my current primary-key-columns in favor of an > uuid-column. > In the postgres-docs I can't find any built-in data-types directly > supporting guids. I found the project pguuid on gborg but it somehow > lacks documentation and doesn't seem very promising (since it doesn't > seem to be touched since three years ago...). > I have found some older discussion on the archives but in the end noone > ever came up with THE solution nor did anyone talk about the > performance-impact using a guid-row as primary key would have over > using, let's say bigint. > Has anyone made some test in this field and can share some experiences? > Would this question be better placed in the hackers list? > > Best regards > > > > Dennis > > ------=_Part_10581_20253078.1151367332080 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline By its definition, GUID ( http://en.wikipedia.org/wiki/GUID ) is not guaranteed to be unique.  As a result, it could cause problems in tables that have a large number of rows - actually this could result in hard to reproduce, seemingly random errors in your systems that use the database.  How does a GUID help you over a BIGSERIAL?

Unless you are generating the PK in multiple databases, a BIGSERIAL should act as a UUID.

Maybe if you provide a little more detail on why you want to use GUID or UUID fields we can help you come up with more options.

Thanks,
Aaron

On 6/26/06, Dennis Wagner <wagner@spheron.com> wrote:
Hi list!

I'm currently thinking about using GUIDs as primary keys. To be more
precise: On *some* of the tables in my structure I *will* need GUIDs (or
UUIDs or whatever format may proove usefull). Now, this implies that
using a bigserial-field for readability and the uids is redundand, so
I'm thinking of dropping my current primary-key-columns in favor of an
uuid-column.
In the postgres-docs I can't find any built-in data-types directly
supporting guids. I found the project pguuid on gborg but it somehow
lacks documentation and doesn't seem very promising (since it doesn't
seem to be touched since three years ago...).
I have found some older discussion on the archives but in the end noone
ever came up with THE solution nor did anyone talk about the
performance-impact using a guid-row as primary key would have over
using, let's say bigint.
Has anyone made some test in this field and can share some experiences?
Would this question be better placed in the hackers list?

Best regards



Dennis

------=_Part_10581_20253078.1151367332080--