Unix Technical Forum

Re: [PATCHES] Patch for UUID datatype (beta)

This is a discussion on Re: [PATCHES] Patch for UUID datatype (beta) within the pgsql Hackers forums, part of the PostgreSQL category; --> > > > > Anyone who thinks UUIDs are guaranteed unique has been drinking too much > > of ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 04:47 AM
Harald Armin Massa
 
Posts: n/a
Default Re: [PATCHES] Patch for UUID datatype (beta)

>
>
> > Anyone who thinks UUIDs are guaranteed unique has been drinking too much
> > of the kool-aid.

>


> Identifier uniqueness considerations:
> This document specifies three algorithms to generate UUIDs: the
> first leverages the unique values of 802 MAC addresses to
> guarantee uniqueness, the second uses pseudo-random number
> generators, and the third uses cryptographic hashing and
> application-provided text strings. As a result, the UUIDs
> generated according to the mechanisms here will be unique from all
> other UUIDs that have been or will be assigned.


That is a quote from the ftp://ftp.rfc-editor.org/in-notes/rfc4122.txt

And to quote ITU-T
"""
If generated according to one of the mechanisms defined in ITU-T Rec. X.667
| ISO/IEC 9834-8 <http://fpweb/ITU-T/studygroups/com17/oid.html>, a UUID is
either guaranteed to be different from all other UUIDs generated before 3603
A.D., or is extremely likely to be different (depending on the mechanism
chosen). The UUID generation algorithm specified in this standard supports
very high allocation rates: 10 million per second per machine if necessary,
so UUIDs can also be used as transaction IDs.
"""

They also talk about a "guaranteed differentness" - and as much as I
understand, they are Unique as long as the MAC-Adresses of the Network-Cards
are unique, and fall back to "extremly likely" when there is no network card
present.

I would really like PostgreSQL to include an uuid-generation function
crafted along the recommendations in rfc4122 or ISO/IEC 9834-8; so those
UUIDs have a "ISO/IEC-defined uniqueness" or at least a "ISO/IEC-defined
extreme likelyness to be unique"

As of now there are at least 3 implementations for UUID creation for
PostgreSQL in the wild; as much as I understand is that "UUIDs created by
the same algorithm" are much more likely to be unique to each other then
UUIDs created by different algorithms.

Harald


--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Let's set so double the killer delete select all.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 04:47 AM
Martijn van Oosterhout
 
Posts: n/a
Default Re: [PATCHES] Patch for UUID datatype (beta)

On Mon, Sep 18, 2006 at 05:29:34PM +0200, Harald Armin Massa wrote:
> I would really like PostgreSQL to include an uuid-generation function
> crafted along the recommendations in rfc4122 or ISO/IEC 9834-8; so those
> UUIDs have a "ISO/IEC-defined uniqueness" or at least a "ISO/IEC-defined
> extreme likelyness to be unique"


The code to get things like the MAC address is going to be a pile of
very OS specific code, which I really don't think is in the realm of
code postgresql wants to maintain. The easier and better solution is to
include a module in contrib (at best) that calls some standard
cross-platform library to do the job.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFDsESIB7bNG8LQkwRAmcCAJwKa7Jb07fT3lzdp1aRJ8 Eym+lFmACcDF3K
RoqOIeIFu8v+4XzCBNbgTaM=
=WMbU
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2008, 04:47 AM
Tom Lane
 
Posts: n/a
Default Re: [PATCHES] Patch for UUID datatype (beta)

"Harald Armin Massa" <haraldarminmassa@gmail.com> writes:
> They also talk about a "guaranteed differentness" - and as much as I
> understand, they are Unique as long as the MAC-Adresses of the Network-Cards
> are unique, and fall back to "extremly likely" when there is no network card
> present.


MAC addresses are not guaranteed unique (heck, on Apple machines they're
user-assignable, and I think you can change 'em on Linux too). Another
unrelated-to-reality assumption in the above claim is that the local
system clock is always accurate (is never, say, set backwards).

You can have a reasonably strong probability that UUIDs generated per spec
within a single well-run network are unique, but that's about as far as
I'd care to believe it.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:43 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com