Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 2370F9FB2DA for ; Wed, 28 Mar 2007 01:20:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 89218-01 for ; Wed, 28 Mar 2007 01:19:57 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by postgresql.org (Postfix) with ESMTP id 7849F9FB972 for ; Wed, 28 Mar 2007 00:51:38 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id k3so81814ugf for ; Tue, 27 Mar 2007 20:51:36 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=GMNmyKoHEkS/ktyRF6qPrW/tEO9ZhckAERKQjL9xJNGGIqSSppJtmZoeMKc2eIAX6wzMgxtaGTLq8gr9kBSnaBGh2dUmzYNscHwc2GA2ka+uP/yODbNRi5YjreuSR0dx0Nu6ipNb5WcX/z/2n57LnKKCglFOI/hkedigA/FI8CU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uZJ+IsIPiixXemC+P40i1AqeQbwF411Lr9Cjil3Wo7XNjtSUzWXiBncKKaeTphmWiSO9VloqwLmg6RlPlN/KcnzuePePSYQmZBX5SXn+rtCgpbl7Cw+ThMB3dE64HbBzrTIIpzKdcIqwv7vKIm+uXdfh2Nn3OPCzHjX0mU+hu8c= Received: by 10.114.15.1 with SMTP id 1mr3483449wao.1175053895412; Tue, 27 Mar 2007 20:51:35 -0700 (PDT) Received: by 10.114.47.8 with HTTP; Tue, 27 Mar 2007 20:51:35 -0700 (PDT) Message-ID: <4f4c2a010703272051g94d88fdkc508a1b1ef189b34@mail.gmail.com> Date: Tue, 27 Mar 2007 23:51:35 -0400 From: "Jon Horsman" To: pgsql-sql@postgresql.org Subject: Re: Foreign Unique Constraint In-Reply-To: <002501c770bd$a42f94a0$9b0014ac@wbaus090> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4f4c2a010703270621h5137a4e5rb515a9be9034a543@mail.gmail.com> <002501c770bd$a42f94a0$9b0014ac@wbaus090> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/326 X-Sequence-Number: 27964 > Perhaps this...? It would work, but depending how many rows are in the > table, it could become incredibly slow. The max rows in either table would be about 1000 or so, which isn't too many. There also should be a hole lot of inserting going on. > ALTER TABLE table1 ADD CHECK (extension NOT IN (SELECT extension FROM > table2)); I guess this is the functionality i was looking for but was hoping there would be a cleaner way to do it. Anyways, thanks to everyone who replied. I'll look into each of the proposed solutions to see what best suits my needs. If anyone has a different solution i'd still like to hear it. Jon