Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id BC1D19FB5B2 for ; Tue, 23 Jan 2007 17:26:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 57371-03 for ; Tue, 23 Jan 2007 17:26:36 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 727359FB521 for ; Tue, 23 Jan 2007 17:26:39 -0400 (AST) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1H9TKe-0008AK-Bk for pgsql-sql@postgresql.org; Tue, 23 Jan 2007 16:37:32 -0500 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id E2DEB4172; Tue, 23 Jan 2007 16:26:28 -0500 (EST) Date: Tue, 23 Jan 2007 16:26:28 -0500 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: select based on multi-column primary keys Message-ID: <20070123212628.GC10352@phlogiston.dyndns.org> References: <45B16602.2080508@furthernorth.net> <20070121152838.GB3533@phlogiston.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/117 X-Sequence-Number: 27269 On Tue, Jan 23, 2007 at 01:07:19PM -0800, codeWarrior wrote: > No... its a table constraint using a unique, implicit index on the listed > columns. . Sure. But since these get added as table constraints after dump anyway, I'm not sure I see why it makes a difference. In any case, the point is that what you call a "real" primary key is an artificial one, and what SQL weenies would think is a "real" primary key is in fact, a natural primary key based on the data in the table. That may well be multiple columns of data. (I know of one really nasty case where it was five. Yes, the application needed rewriting. But it was normalised :) A -- Andrew Sullivan | ajs@crankycanuck.ca A certain description of men are for getting out of debt, yet are against all taxes for raising money to pay it off. --Alexander Hamilton