Re: GUID in postgres
От | John Hasler |
---|---|
Тема | Re: GUID in postgres |
Дата | |
Msg-id | 87snc7x5kv.fsf@toncho.dhh.gt.org обсуждение исходный текст |
Ответ на | Re: GUID in postgres (Horst Herb <hherb@malleenet.net.au>) |
Список | pgsql-sql |
I wrote: > Globally Unique IDentifier, probably. Just hash a 128 bit random number > with the current date. Horst writes: > That gives you no gurantee it will be unique. There is no such guarantee. The probability of a collision due to errors and bugs using a "deterministic" system is sure to be at least as large as the the probability of a chance collision using large random numbers (_random_, not pseudorandom). Stick machine, table, and database ID's in there as well if it makes you more comfortable, but even without them the risk of a collision is down there with the risk of cosmic ray induced errors. _Nothing_, however, can make it zero. > - All tables in need of a global ID _within_ a database inherit a globid > table which contains nothing but an ID of type serial. - When we need > cross-database unique IDs within the same system, the globid table > contains a database identifier as well (like the OID of the pg_database > entry for the database). And that's fine, but the GUID system uses the word "global" in a much more grandiose sense. -- John Hasler john@dhh.gt.org Dancing Horse Hill Elmwood, Wisconsin
В списке pgsql-sql по дате отправления: