Re: uuid type for postgres

Поиск
Список
Период
Сортировка
От nathan wagner
Тема Re: uuid type for postgres
Дата
Msg-id 20050907023606.GA2181@granicus.if.org
обсуждение исходный текст
Ответ на Re: uuid type for postgres  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: uuid type for postgres  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
On Tue, Sep 06, 2005 at 06:40:27PM -0700, josh@agliodbs.com wrote:
> Sure.  What's a UUID, after all?   It's three pieces of information:
> 1) A server or database instance identifier
> 2) A table identifier
> 3) A row identifier
> 
> e.g.:
> chayote.sf.agliodbs.com | public.customers | 4271
> 
> Generally, it's pretty easy to just grab these 3 pieces of information 
> separately and pass them with the data when you want to transmit between 
> servers.  If there are space/overhead considerations, you can put them 
> into a reversable hash.

Take a look at the version 3 or version 5 UUIDs.  They essentially do this.
The hash isn't reversable, but rather recreatable.  Seems that if it
were reversable, it would be compression, not a hash.  Anyway.

You're assuming though that you want to leak this information.  If you do,
or you don't care, go ahead with the v3 or v5 uuid creator.

Or use v1 if you want mac/time based uuids, or v4 for random uuids.

The convenient thing about using the uuid library is that all of these
mechanisms result in the same type, and are thus compatible.

> I've never understood the complex measures which 
> application developers take to create "universal" IDs.

Different applications have different goals.  Unguessability might
be important in some contexts.

-- 
Nathan Wagner


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

Предыдущее
От: "Dann Corbit"
Дата:
Сообщение: Re: uuid type for postgres
Следующее
От: Andrew - Supernews
Дата:
Сообщение: Re: inet increment with int