Re: Proposal for GUID datatype

From: mark(at)mark(dot)mielke(dot)cc
To: Jan de Visser <jdevisser(at)digitalfairway(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Gevik Babakhani <pgdev(at)xs4all(dot)nl>
Subject: Re: Proposal for GUID datatype
Date: 2006-09-09 05:33:31
Message-ID: 20060909053331.GA28792@mark.mielke.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 09, 2006 at 01:03:24AM -0400, Jan de Visser wrote:
> On Saturday 09 September 2006 00:42, mark(at)mark(dot)mielke(dot)cc wrote:
> > But if the input isn't 32 hexadecimal characters - I don't see how
> > it fits the UUID/GUID type.

> Again, it wasn't about that particular *value* (which, as I
> concurred, is not a [GU]UID). It was about the fact that different
> tools spit out stuff in different formats, and that it would suck
> royally if you would have to convert because Gevik didn't think of
> the particular format of your particular tool.

> But I guess your suggestion of just ignoring punctuation would work
> just fine.

I don't think so. If it isn't 128 bits - and you want to fit it into
128 bits, it means padding. Where should the padding go? As application
specific, it is up to the application to convert.

I don't agree that a GUID/UUID type should do much more than allow a
GUID/UUID to fit into it. It is not a type that can be used to
represent any UID you happen to have. With a 64 bit UID or 96 bit UID
- why would you want to store it in 128-bits anyways? This would be
a waste of space.

For the same reason I wouldn't want to store an MD5SUM into a UUID
type. It's an abuse of the type. If the type was called hexstring32
or something like that, sure.

Philosophy is involved. Making UUID understand every possible format,
and know how to pad each format that doesn't use 32 hexadecimal
characters is outside the scope of this discussion, and guarantees
that it will never be implemented. There will always be one more
format somebody wants to cram into it.

UUID is not a UID. UUID is a 128-bit number with a fairly specific
format that includes a version number, and each of the bit segments
within it are used to signify a different type of data, based upon the
version number.

Cheers,
mark

--
mark(at)mielke(dot)cc / markm(at)ncf(dot)ca / markm(at)nortel(dot)com __________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada

One ring to rule them all, one ring to find them, one ring to bring them all
and in the darkness bind them...

http://mark.mielke.cc/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Browne 2006-09-09 10:25:34 Re: [HACKERS] Fix linking of OpenLDAP libraries
Previous Message Alvaro Herrera 2006-09-09 05:06:08 Re: Proposal for GUID datatype