-------- Original Message --------
Subject: Re: [GENERAL] UUID column as pimrary key?
Date: Wed, 5 Jan 2011 10:11:49 -0700
From: Scott Ribe <scott_r...@elevated-dev.com>
To: Adrian Klaver <adrian.kla...@gmail.com>

On Jan 5, 2011, at 9:57 AM, Adrian Klaver wrote:

Maybe or maybe not:)

So... If you choose to use a name-based UUID, *and* you do a bad job of picking a name, then you have a much higher risk of collision. But it's a pretty good bet (as in 100% of all operating systems that I know of) that if you simply call the OS's uuid function that won't happen.


--
Scott Ribe


First this is one of those arguments that can go forever because everyone is both a bit right and a bit wrong.

Second the original questions was UUID in the context of Postgres and the UUID generation algorithm using name is one of the choices in the Postgres module:
http://www.postgresql.org/docs/9.0/interactive/uuid-ossp.html
So there is a likelihood that it may be used.

Third the above was a response to your assertion that the ITEF guaranteed UUID uniqueness.

Lastly Adrians First Rule applies:
"The good will take care of itself, its the bad you have to plan for."

The problem is not if people do the right thing it is if they do the wrong thing. As someone else upstream pointed the OP was looking to use UUIDs as a PK and in that case the database will enforce another "namespace" and in worst case you will need to retry with a different UUID. That covers the bad.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to