Re: UUIDs generated using ossp-uuid on windows not unique - Mailing list pgsql-bugs

From Stefan Kaltenbrunner
Subject Re: UUIDs generated using ossp-uuid on windows not unique
Date
Msg-id 4856C6B5.2030303@kaltenbrunner.cc
Whole thread Raw
In response to Re: UUIDs generated using ossp-uuid on windows not unique  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: UUIDs generated using ossp-uuid on windows not unique
List pgsql-bugs
Tom Lane wrote:
> Meetesh Karia <meetesh.karia@gmail.com> writes:
>> As best as I can tell, the problem is caused because generation of v1
>> UUIDs uses GetSystemTimeAsFileTime which is stated to have a resolution
>> of 100 nanoseconds but in practice has a resolution of around 15ms
>> (http://www.ddj.com/showArticle.jhtml?documentID=win0305a&pgno=17).
>
> Well, any real-time clock reading is going to have finite resolution.
> If your app is expecting that version-1 UUIDs generated in rapid
> succession will be distinct, I think your app is broken.  It's just
> a little more obvious on Windows :-(.
>
> Perhaps the v4 generation method would work better for you?

actually this has been reported before and seems to be an issue in the
windows port of the ossp-uuid library:


http://archives.postgresql.org/pgsql-bugs/2008-05/msg00059.php


Stefan

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: UUIDs generated using ossp-uuid on windows not unique
Next
From: Tom Lane
Date:
Subject: Re: UUIDs generated using ossp-uuid on windows not unique