Fwd: Re: UUID column as pimrary key?

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Fwd: Re: UUID column as pimrary key?
Дата
Msg-id 4D24AB39.2080505@gmail.com
обсуждение исходный текст
Список 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@elevated-dev.com>
To: Adrian Klaver <adrian.klaver@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.


В списке pgsql-general по дате отправления:

Предыдущее
От: Radosław Smogura
Дата:
Сообщение: Re: UUID column as pimrary key?
Следующее
От: Filip Rembiałkowski
Дата:
Сообщение: Re: How can I get the list of index(or other objects) which depends on a function