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

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: [PATCHES] Patch for UUID datatype (beta)
Дата
Msg-id 20060919135305.GV47167@enterprisedb.com
обсуждение исходный текст
Ответ на Re: [PATCHES] Patch for UUID datatype (beta)  (Gevik Babakhani <pgdev@xs4all.nl>)
Список pgsql-hackers
On Tue, Sep 19, 2006 at 03:35:55PM +0200, Gevik Babakhani wrote:
> > As others have mentioned, using MAC address doesn't remove the
> > possibility of a collision.
> > 
> > Maybe a good compromise that would allow a generator function to go into
> > the backend would be to combine the current time with a random number.
> > That will ensure that you won't get a dupe, so long as your clock never
> > runs backwards.
> 
> I think that is a reasonable solution. I just wonder if there is a cross
> platform way to get the MAC address for all OS we support.

Well... how much OS-specific code do you want? :)

Another (not as good) possibility would be to use the IP address (along
with time and a random number).
-- 
Jim Nasby                                    jimn@enterprisedb.com
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Release notes
Следующее
От: Mark Cave-Ayland
Дата:
Сообщение: Re: -HEAD planner issue wrt hash_joins on dbt3 ?