Re: uuid type for postgres - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: uuid type for postgres
Date
Msg-id 200509070948.08307.josh@agliodbs.com
Whole thread Raw
In response to Re: uuid type for postgres  (nathan wagner <nw@hydaspes.if.org>)
Responses Re: uuid type for postgres
List pgsql-hackers
Nathan,

> Take a look at the version 3 or version 5 UUIDs.  They essentially do this.
> The hash isn't reversable, but rather recreatable.  Seems that if it
> were reversable, it would be compression, not a hash.  Anyway.

Hmmm, yes, true.

> You're assuming though that you want to leak this information.  If you do,
> or you don't care, go ahead with the v3 or v5 uuid creator.
>
> Or use v1 if you want mac/time based uuids, or v4 for random uuids.
>
> The convenient thing about using the uuid library is that all of these
> mechanisms result in the same type, and are thus compatible.

That's good, it gives users options.  And I can see why you don't want to 
re-create the functionality in PG code, it's probably pretty large.

> > I've never understood the complex measures which
> > application developers take to create "universal" IDs.
>
> Different applications have different goals.  Unguessability might
> be important in some contexts.

Well, IMHO, if the unguessability of UUIDs is an important part of your spec, 
you have some design problems.   But it's not my job to lock up the 
foot-guns, just to make sure they come with warnings ...

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Attention PL authors: want to be listed in template table?
Next
From: Josh Berkus
Date:
Subject: Re: uuid type for postgres