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 09A4E5E4249 for ; Wed, 18 Aug 2004 16:35:42 -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 23457-05 for ; Wed, 18 Aug 2004 19:35:45 +0000 (GMT) Received: from davinci.ethosmedia.com (server226.ethosmedia.com [209.128.84.226]) by svr1.postgresql.org (Postfix) with ESMTP id 8F8035E40BA for ; Wed, 18 Aug 2004 16:35:36 -0300 (ADT) Received: from [64.81.245.111] (account josh@agliodbs.com HELO temoku.sf.agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 6113801; Wed, 18 Aug 2004 12:37:02 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Bruno Wolff III Subject: Re: multi column foreign key for implicitly unique columns Date: Wed, 18 Aug 2004 12:36:14 -0700 User-Agent: KMail/1.6.2 Cc: pgsql-sql@postgresql.org References: <1092734724.2627.4.camel@dicaprio.akademie1.de> <200408181005.13230.josh@agliodbs.com> <20040818192440.GB21979@wolff.to> In-Reply-To: <20040818192440.GB21979@wolff.to> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408181236.14736.josh@agliodbs.com> 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: 200408/214 X-Sequence-Number: 18711 Bruno, > If users is supposed to reference status you can do this by adding a > relation column to users, using a constraint to force relation to always be > 'users' and then having (status, relation) being a foreign key. But that requires the addition of an extra, indexed Text column to the table. And the "status" reference table is not the only place I need this construct; I have other relationships to reference tables which are similar. It would amount to adding probably a total of 25-40 columns to various tables in my database overall; maybe 100MB of completely redundant data. :-( I'll wait for ASSERTIONS, I think. -- --Josh Josh Berkus Aglio Database Solutions San Francisco