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

From: "Harald Armin Massa" <haraldarminmassa(at)gmail(dot)com>
To: "mark(at)mark(dot)mielke(dot)cc" <mark(at)mark(dot)mielke(dot)cc>
Cc: "Jim C(dot) Nasby" <jimn(at)enterprisedb(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, "Andreas Pflug" <pgadmin(at)pse-consulting(dot)de>, "Gevik Babakhani" <pgdev(at)xs4all(dot)nl>, pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Patch for UUID datatype (beta)
Date: 2006-09-20 07:02:56
Message-ID: 7be3f35d0609200002n19af5287r642614ab572f7352@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Mark,

>
> A model that intended to try and guarantee uniqueness would provide a
> UUID generation service for the entire host, that was not specific to
> any application, or database, possibly accessible via the loopback
> address. It would ensure that at any given time, either the time is
> new, or the sequence is new for the time. If computer time ever went
> backwards, it could keep the last time issued persistent, and
> increment from this point forward through the clock sequence values
> until real time catches up. An alternative would be along the lines of
> a /dev/uuid device, that like /dev/random, would be responsible for
> outputting unique uuid values for the system. Who does this? Probably
> nobody. I'm tempted to implement it, though, for my uses. :-)
>

That is an excellent summary. There is just one wrong assumption in it:

>Probably nobody.

Within win32 there is an API call, which provides you with an GUID / UUID
with to my knowledge exactly the features you are describing. win32 is
installed on some computers. So for PostgreSQL on win32 the new_guid() you
describe in detail would be quite simple to implement: a call to
CoCreateGuid.

The challenging part is: I use PostgreSQL in a mixed environment. And Linux
i.e. does not provide CoCreateGuid. That's why I am voting to have it in
PostgreSQL :)

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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2006-09-20 07:56:37 Re: pgsql: Remove completed TODO items: < * -Make postmater
Previous Message Jeremy Drake 2006-09-20 06:07:18 Re: polite request about syntax

Browse pgsql-patches by date

  From Date Subject
Next Message Gregory Stark 2006-09-20 09:04:00 Re: [PATCHES] Patch for UUID datatype (beta)
Previous Message mark 2006-09-20 04:04:27 Re: [HACKERS] Patch for UUID datatype (beta)