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 04:42:29
Message-ID: 20060909044229.GA27556@mark.mielke.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 08, 2006 at 10:49:21PM -0400, Jan de Visser wrote:
> On Friday 08 September 2006 21:34, mark(at)mark(dot)mielke(dot)cc wrote:
> > On Fri, Sep 08, 2006 at 09:24:19PM -0400, Jan de Visser wrote:
> > > On Friday 08 September 2006 15:18, Gevik Babakhani wrote:
> > > > 2a) Three input formats are supported.
> > > > example:
> > > > insert into tbl (fld) values('1dfb39af-b56a-40b8-a903-b5b31567c3ce');
> > > > insert into tbl (fld) values('{1dfb39af-b56a-40b8-a903-b5b31567c3ce}');
> > > > insert into tbl (fld) values('1dfb39afb56a40b8a903b5b31567c3ce');
> > >
> > > Please extend your list. java's RMI package generates UIDs with the
> > > following format:
> > >
> > > [head order 21:19]$ bsh.sh
> > > BeanShell 1.3.0 - by Pat Niemeyer (pat(at)pat(dot)net)
> > > bsh % print(new java.rmi.server.UID());
> > > 3b732da7:10d9029b3eb:-8000
> > > bsh %
> > That doesn't look like a UUID/GUID - unless it trims leading zeroes?
> > UUID/GUID = 128-bits = 32 hexadecimal characters.

> I know, it's a UID. Not a GUID. But many people (including myself)
> use it as a base to generate GUIDs. And that's not really the
> point. The point is that I'm afraid he's going to restrict himself
> to much.

I'm not sure what it would do with this input though. Where do the
bits go in a fixed 128-bit field? I think with and with dashes is
fine. { and } starts to get into the unnecessary. At this point, it
may as well ignore all punctuation characters, which stays fine.
Less error checking required.

But if the input isn't 32 hexadecimal characters - I don't see how
it fits the UUID/GUID type.

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 Jan de Visser 2006-09-09 05:03:24 Re: Proposal for GUID datatype
Previous Message Tom Lane 2006-09-09 04:11:12 Re: ISBN/ISSN/ISMN/EAN13 module