Received: from forward.airstreamcomm.net (forward.airstreamcomm.net [64.33.128.12]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9PCZ5P60759 for ; Thu, 25 Oct 2001 08:35:06 -0400 (EDT) (envelope-from jghasler@svtel.net) Received: from hasler.dhh.gt.org (elk-ras1-cs-116.dial.airstreamcomm.net [64.33.137.118]) by forward.airstreamcomm.net (8.12.0/8.12.0) with ESMTP id f9PCYu4R020484 for ; Thu, 25 Oct 2001 07:34:59 -0500 (CDT) Received: from [192.168.1.3] (helo=toncho.dhh.gt.org ident=mail) by hasler.dhh.gt.org with esmtp (Exim 3.12 #1 (Debian)) id 15wjiq-0000MH-00 for ; Thu, 25 Oct 2001 07:34:56 -0500 Received: from john by toncho.dhh.gt.org with local (Exim 3.12 #1 (Debian)) id 15wjh2-0006yD-00; Thu, 25 Oct 2001 07:33:04 -0500 To: pgsql-sql@postgresql.org Subject: Re: GUID in postgres References: <87adyhx7ew.fsf@toncho.dhh.gt.org> <20011025034926.30847.qmail@gnumed.dhs.org> From: John Hasler Date: 25 Oct 2001 07:33:04 -0500 In-Reply-To: <20011025034926.30847.qmail@gnumed.dhs.org> Message-ID: <87snc7x5kv.fsf@toncho.dhh.gt.org> Lines: 28 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200110/354 X-Sequence-Number: 5307 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