Re: GUID/UUID Support

From: "Jeremy Haile" <jhaile(at)fastmail(dot)fm>
To: "Patrick Earl" <patearl(at)patearl(dot)net>, "Chad Wagner" <chad(dot)wagner(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: GUID/UUID Support
Date: 2007-01-18 18:09:15
Message-ID: 1169143755.16441.1169957743@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I second the desire for a UUID type in PostgreSQL! I'm aware of the
pguuid project, but it's not the same as having it in core and isn't
very well maintained.

This is such a common database paradigm that it seems reasonable to
promote it to first-class citizen status in PostgreSQL.

I currently use varchars for UUIDs, but the table size, index size,
integrity (validation), and performance would be better if PostgreSQL
supported UUIDs directly.

On Thu, 18 Jan 2007 10:31:26 -0700, "Patrick Earl" <patearl(at)patearl(dot)net>
said:
> One issue is that UUIDs are only 16 bytes of data. To store the as
> text in canonical form requires 36 bytes. As there are alternate
> frequently used representations, you also run into potential issues
> with input. The GUID type (proposed by Gevik) handles those standard
> input variations.
>
> Though I haven't tried it, I would imagine there would be performance
> implications when using 36 character keys everywhere to do indexing,
> joins, etc.
>
> Another issue is that higher level languages (such as Delphi and .NET)
> have GUID field types built in. If the field is just a string field,
> it won't map nicely to those higher level types.
>
> Patrick
>
> On 1/17/07, Chad Wagner <chad(dot)wagner(at)gmail(dot)com> wrote:
> > On 1/17/07, Patrick Earl <patearl(at)patearl(dot)net> wrote:
> > > Certainly support for the GUID field type itself is most important.
> > > As for the generators, though they are non-essential, they are very
> > > useful. Other platforms and libraries have standardized on uuid
> > > generators, so I don't see why PostgreSQL can't.
> >
> > Maybe I am oblivious to the reason, but why is there a need for a special
> > data type for GUID/UUIDs? Wouldn't you always be doing an "equality"
> > anyways? Wouldn't a varchar suffice?
> >
> > --
> > Chad
> > http://www.postgresqlforums.com/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-01-18 18:24:28 Re: Clearing plans
Previous Message Scott Ribe 2007-01-18 17:43:41 Clearing plans