pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Keary Suska <hierophant@pcisys.net>
To: Postgres-PHP <pgsql-php@postgresql.org>
Subject: Re: UUID/GUID information
Date: Thu, 30 May 2002 15:16:28 -0600
Message-ID: <B91BF2CC.F02C%hierophant@pcisys.net> (raw)
In-Reply-To: <35363AB30BF2D311B73C0050DAB989F063C3@SEAPDC01>

on 5/30/02 2:05 PM, Busby@pnts.com purportedly said:

> Dear List,
> Thank you for the prompt responses...I read the MAN on OID and also
> on SERIAL...the benefit of using the MS-UUID is that the identifier created
> is guarenteed to be unique in spacetime.  OID and SERIAL are not...they are
> only guarenteed to be unique in a database.
> 
> Perhaps I should have mentioned that I'm building a multi-database solution
> (20+ databases) in which all 20+ DBs must use the same identifier across
> databases for some objects (ex: Automobile Brands) but their own identifier
> for their own data (ex: Accouts/Clients) this way when the child database
> publish to the master there is no possiblity of some object having the same
> identifer as another...and the object identifier can stay the same across
> all 20+ DBs.  
> 
> 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.

AFAIK Postgres doesn't have such a feature built-in, so you would have to do
it yourself. If Db access is entirely web-based, and you use Apache,
mod_unique may do what you want, and it is supposed to be unique throughout
time. However, it may not be unique across multiple Apache installations, if
you have such an environment.

To use Postgres alone, you would likely need a particular database that
"tracks" unique ids. It adds a bit of overhead, and you face parallel access
issues. You can mimic a 16-byte number using 4 INT4 fields (unless your
platform supports 64 bit numbers), but you would have to watch for overflow,
which can get confusing since Postgres doesn't have the notion of unsigned
integers. Fortunately, you can set up triggers/stored procedures that will
handle all of this automatically.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"




view thread (7+ messages)  latest in thread

Message-ID: <B91BF2CC.F02C%hierophant@pcisys.net>
Permalink:  ../B91BF2CC.F02C%25hierophant@pcisys.net/
Also on:    postgresql.org/message-id/B91BF2CC.F02C%hierophant@pcisys.net

 · 

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: hierophant@pcisys.net
  Subject: Re: UUID/GUID information
  In-Reply-To: <B91BF2CC.F02C%hierophant@pcisys.net>
  References: <35363AB30BF2D311B73C0050DAB989F063C3@SEAPDC01> <B91BF2CC.F02C%hierophant@pcisys.net>

* 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