Re: GUID in postgres

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: <postgresql_sql(at)kaiserdigital(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: GUID in postgres
Date: 2001-10-26 20:00:04
Message-ID: web-492993@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

"Kaiserdigital":

> 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's a relational integrity issue. A GUID, by definition, contains two
pieces of information:
1. The local primary key
2. The server unique ID
As such, RDBMS design principles (the Second Normal Form, I believe,
correct me if I'm remebering wrong) mandates that they be kept in two
columns.

This is a pet peeve of mine, as DB vendors and beginner DBA's today seem
to be in a rush to embrase "non-atomic" fields willy-nilly, abandoning
20 years of accumulated RDBMS wisdom.

> 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.

Makes sense if you have an open-ended network of machines so that a
simple numbering sequence won't work. With 3 servers, "1", "2", "3"
work just as well, and don't have the 12-byte overhead of a MAC address.

-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

Browse pgsql-general by date

  From Date Subject
Next Message Seth Hettich 2001-10-26 20:09:28 Re: initdb segfault - solaris 8
Previous Message Tom Lane 2001-10-26 19:15:49 Re: initdb segfault - solaris 8

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitry G. Mastrukov Дмитрий Геннадьевич Мастрюков 2001-10-26 23:31:04 Re: GUID in postgres
Previous Message Thomas Swan 2001-10-26 19:58:56 Re: Granting database level permissions...