X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 151CFD1B25F for ; Wed, 21 Jul 2004 12:11:14 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 88814-09 for ; Wed, 21 Jul 2004 15:10:53 +0000 (GMT) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1E3DED1B3B2 for ; Wed, 21 Jul 2004 12:10:52 -0300 (ADT) Received: from [134.22.68.4] (dyn-68-4.tor.dsl.tht.net [134.22.68.4]) by tht.net (Postfix) with ESMTP id F09F876B0B; Wed, 21 Jul 2004 11:10:53 -0400 (EDT) Subject: Re: surrogate key or not? From: Rod Taylor To: Josh Berkus Cc: Iain , Markus Bertheau , pgsql-sql@postgresql.org In-Reply-To: <200407210001.00102.josh@agliodbs.com> References: <1090325769.3241.27.camel@dicaprio.akademie1.de> <004101c46ec2$631ca930$7201a8c0@mst1x5r347kymb> <200407210001.00102.josh@agliodbs.com> Content-Type: text/plain Message-Id: <1090422650.21450.13.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 21 Jul 2004 11:10:51 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/158 X-Sequence-Number: 18410 > All three of these implementation issues are, at least in theory, > surmountable. For example, Sybase overcame problems (1) and (3) by creating > an automated, system-controlled hash key based on the table's real key. This > was a solution endorsed by E.F. Codd in the mid-90's when he came to regret > his promotion of the "Primary Key" idea in the SQL standard. I've often wondered if the OID was intended to be something similar. You specify: CREATE TABLE abc (key varchar(120) PRIMARY KEY); CREATE TABLE bcd (key varchar(120) REFERENCES abc); PostgreSQL was actually supposed to create: abc(oid oid, key varchar(120) PRIMARY KEY); bcd(key oid REFERENCES abc(oid)); Then muck around with the queries to resolve the actual varchar() name when required.