Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 2A5FE9FB8FB for ; Wed, 28 Mar 2007 06:08:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 06693-04 for ; Wed, 28 Mar 2007 06:08:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from gauss.credativ.com (ipx11302.ipxserver.de [212.112.227.254]) by postgresql.org (Postfix) with ESMTP id A90039FB88A for ; Wed, 28 Mar 2007 06:08:16 -0300 (ADT) Received: from archimedes.credativ.lan (unknown [87.139.82.80]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by gauss.credativ.com (Postfix) with ESMTP id 9A7D3D7925; Wed, 28 Mar 2007 11:08:09 +0200 (CEST) From: Peter Eisentraut To: pgsql-sql@postgresql.org Subject: Re: Foreign Unique Constraint Date: Wed, 28 Mar 2007 11:08:07 +0200 User-Agent: KMail/1.9.5 Cc: "Phillip Smith" , "'Jon Horsman'" References: <002501c770bd$a42f94a0$9b0014ac@wbaus090> In-Reply-To: <002501c770bd$a42f94a0$9b0014ac@wbaus090> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200703281108.08697.peter_e@gmx.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/327 X-Sequence-Number: 27965 Am Mittwoch, 28. März 2007 00:17 schrieb Phillip Smith: > Perhaps this...? It would work, but depending how many rows are in the > table, it could become incredibly slow. > > ALTER TABLE table1 ADD CHECK (extension NOT IN (SELECT extension FROM > table2)); Subqueries are not allowed in check constraints. -- Peter Eisentraut http://developer.postgresql.org/~petere/