Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9QK07P99222 for ; Fri, 26 Oct 2001 16:00:07 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.7) with HTTP id 492993; Fri, 26 Oct 2001 13:00:04 -0700 From: "Josh Berkus" Subject: Re: GUID in postgres To: , X-Mailer: CommuniGate Pro Web Mailer v.3.4.7 Date: Fri, 26 Oct 2001 13:00:04 -0700 Message-ID: In-Reply-To: <004501c15e50$ffd4df20$0c00a8c0@mouse> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200110/377 X-Sequence-Number: 5329 "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@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco