Re: GUID in postgres

From: <postgresql_sql(at)kaiserdigital(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: GUID in postgres
Date: 2001-10-26 19:04:12
Message-ID: 004501c15e50$ffd4df20$0c00a8c0@mouse
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Hi

The overhead in generating GUIDs is minimal.

I've never heard of a GUID implementation that uses random numbers. In
most cases it is a functions of the date, a sequence, and/or the MAC.

Why would you want to use two columns when you use could one? Two
columns in each table would clutter your scheme as well as your
procedures.

It doesn't matter if you change the network card. The GUIDs will still
be unique. The MAC does not make the GUID unique on any given server.
The rest of the GUID generation function accomplishes this task. All
that is accomplished by incorporating the MAC into the GUID is
uniqueness between machines.

-----Original Message-----
From: Josh Berkus [mailto:josh(at)agliodbs(dot)com]
Sent: Friday, October 26, 2001 11:31 AM
To: postgresql_sql(at)kaiserdigital(dot)com; pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] GUID in postgres

Folks,

> I think most of you are missing the point here.
>
> GUIDs are unique and they are required for Enterprise development.

I don't know. I have yet to hear a persuasive argument as to why none
of the schemes previously mentioned would not work. While a "GUID"
automated by the RDBMS platform is convenient, it is by no means
necessary. Any number of approaches can be substituted.

For example, I have a system that requires middleware-level interaction
between 3 database servers. The main data tables in these databases all
have 2-column primary keys; one column for the (locally unique)
sequence, one column for the (globally unique) server ID. This scheme
fulfills all of the functionality that you describe, without the
overhead of complex random seed mechanisms or other proprietary
overhead. Also, any requests that are strictly local in nature need
only query the local id without worrying about the second column.

> Do a search for "multi master replication" and you should pick up some
> info on how to properly implement a GUID. The simplest approach is to
> use some combination of a sequence and the MAC address.

SO what happens if you swap out the network card?

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-10-26 19:15:49 Re: initdb segfault - solaris 8
Previous Message Rich Shepard 2001-10-26 18:52:01 Re: null != null ???

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Dyrby Jensen 2001-10-26 19:55:53 Deletion Recursively
Previous Message Josh Berkus 2001-10-26 18:31:16 Re: GUID in postgres