Re: How can I build OSSP UUID support on Windows to avoid duplicate UUIDs?

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, MauMau <maumau307(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Hiroshi Saito <hiroshi(at)winpg(dot)jp>, Dave Page <dpage(at)pgadmin(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How can I build OSSP UUID support on Windows to avoid duplicate UUIDs?
Date: 2013-10-31 12:44:54
Message-ID: 20131031124454.GC31628@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-10-31 08:22:14 -0400, Robert Haas wrote:
> On Wed, Oct 30, 2013 at 5:32 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > "MauMau" <maumau307(at)gmail(dot)com> writes:
> > Note the lack of enthusiasm for taking on maintainership of the OSSP
> > code. Pushing it into core would mean that we're buying into that
> > maintainership, hook line and sinker. I don't think that such a
> > proposal would fly.
>
> ISTM that the biggest problem is that we don't have a random number
> generator which generates enough bits of randomness to implement
> uuid_generate_v3. I think relatively few people would cry if we
> didn't support uuid_generate_v1(), and the others all look simple
> enough, provided there's somewhere to get lots of random bits.

Yea, I think restricting ourselves to v3/4/5 is a sensible thing.

> On Linux, it seems like we could get those bits from /dev/urandom,
> though I'm not sure how efficient that would be for the case where
> many UUIDs are being generated at once. But that wouldn't be very
> portable. It's tempting to think that we'd need a PRNG that generates
> wider values, for which we might find other application also. But I'm
> not volunteering to be the one to create such a thing.

We could copy ossp's implementation, it's just 200 lines and seems to
have a compatible license.
util-linux's libuuid is BSD as well and seems to have some windows
support although that's by memory.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2013-10-31 12:48:58 Re: Creating partial index on a relation
Previous Message Kevin Grittner 2013-10-31 12:42:01 Re: Creating partial index on a relation