Skip site navigation (1) Skip section navigation (2)

Fwd: Re: UUID column as pimrary key?

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Fwd: Re: UUID column as pimrary key?
Date: 2011-01-05 17:32:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general

-------- Original Message --------
Subject: Re: [GENERAL] UUID column as pimrary key?
Date: Wed, 5 Jan 2011 10:11:49 -0700
From: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)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:
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.

pgsql-general by date

Next:From: Filip RembiałkowskiDate: 2011-01-05 17:37:43
Subject: Re: How can I get the list of index(or other objects) which depends on a function
Previous:From: Radosław SmoguraDate: 2011-01-05 17:30:42
Subject: Re: UUID column as pimrary key?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group