pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew McMillan <andrew@catalyst.net.nz>
To: David Busby <Busby@pnts.com>
Cc: Postgres-PHP <pgsql-php@postgresql.org>
Subject: Re: UUID/GUID information
Date: 01 Jun 2002 00:49:00 +1200
Message-ID: <1022849340.30236.220.camel@kant.mcmillan.net.nz> (raw)
In-Reply-To: <35363AB30BF2D311B73C0050DAB989F063C3@SEAPDC01>
References: <35363AB30BF2D311B73C0050DAB989F063C3@SEAPDC01>

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?




view thread (7+ messages)

Message-ID: <1022849340.30236.220.camel@kant.mcmillan.net.nz>
Permalink:  ../1022849340.30236.220.camel@kant.mcmillan.net.nz/
Also on:    postgresql.org/message-id/1022849340.30236.220.camel@kant.mcmillan.net.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: andrew@catalyst.net.nz, Busby@pnts.com
  Subject: Re: UUID/GUID information
  In-Reply-To: <1022849340.30236.220.camel@kant.mcmillan.net.nz>
  References: <35363AB30BF2D311B73C0050DAB989F063C3@SEAPDC01> <1022849340.30236.220.camel@kant.mcmillan.net.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox