Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id C5A3C4765E0 for ; Fri, 31 May 2002 08:49:54 -0400 (EDT) Received: from heidegger.catalyst.net.nz (203-96-145-236.adsl.paradise.net.nz [203.96.145.236]) by postgresql.org (Postfix) with ESMTP id 4F661475E21 for ; Fri, 31 May 2002 08:49:01 -0400 (EDT) Received: from 127.0.0.1 (ident=unknown) by heidegger.catalyst.net.nz with esmtp (masqmail 0.2.8) id 17Dlq0-6xN-00; Sat, 01 Jun 2002 00:49:00 +1200 Subject: Re: UUID/GUID information From: Andrew McMillan To: David Busby Cc: 'Postgres-PHP' In-Reply-To: <35363AB30BF2D311B73C0050DAB989F063C3@SEAPDC01> References: <35363AB30BF2D311B73C0050DAB989F063C3@SEAPDC01> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 01 Jun 2002 00:49:00 +1200 Message-Id: <1022849340.30236.220.camel@kant.mcmillan.net.nz> Mime-Version: 1.0 X-Archive-Number: 200205/119 X-Sequence-Number: 1251 On Fri, 2002-05-31 at 08:05, David Busby wrote: > > The GUID from Micro$oft is formatted like > {01234567-89AB-CDEF-0123-456789ABCDEF} it represents a 16 byte number that > is again unique in spacetime. Is there PostgreSQL solution for something > like that or will I have to come up with my own. There is an RFC defining GUID and UUID, and it isn't a major job to generate them yourself. If you implement a function to do so you may want to contribute it back to the PostgreSQL community. The basic approach uses IP address, date and time and some other stuff I forget right now. GUID's are actually pretty neat, because they are sortable, but still unique, I believe. It sounds like a straight timestamp + IP address would be sufficient for you. In a similar multi-system problem I am working on I actually just use a two-field key with a serial and a machine name. Using a machine name explicitly, and splitting it into a separate field, actually offers the advantage of making it clearer where the transaction came from, and consequently how my replication model works. Steer well clear of OIDs - they are not necessarily persistent over backup / restore, and they offer little real utility in PostgreSQL these days being something of an appendix from it's time-travelling days. I actually disable them on most user tables when running under 7.2.1 . Regards, Andrew. -- -------------------------------------------------------------------- Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267 Are you enrolled at http://schoolreunions.co.nz/ yet?