X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 4B363EFFF2 for ; Fri, 6 Jun 2003 12:17:27 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 68546-07 for ; Fri, 6 Jun 2003 12:17:26 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 659B6EFF8D for ; Fri, 6 Jun 2003 12:17:25 +0000 (GMT) Received: (qmail 30132 invoked by uid 500); 6 Jun 2003 12:20:01 -0000 Date: Fri, 6 Jun 2003 07:20:01 -0500 From: Bruno Wolff III To: mallah@trade-india.com Cc: pgsql-sql@postgresql.org Subject: Re: simulating partial fkeys.. Message-ID: <20030606122001.GA30097@wolff.to> Mail-Followup-To: mallah@trade-india.com, pgsql-sql@postgresql.org References: <1153.219.65.253.151.1054824932.squirrel@mail.trade-india.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1153.219.65.253.151.1054824932.squirrel@mail.trade-india.com> User-Agent: Mutt/1.5.4i X-Archive-Number: 200306/30 X-Sequence-Number: 13788 On Thu, Jun 05, 2003 at 20:25:32 +0530, mallah@trade-india.com wrote: > > > hi , > > Is there any way to enforce fkeys only on subset of > the table something on the lines of unique partial indexes > > or any work around ? (on update or insert trigger is the only thing i can think of) If the foreign column is null it isn't checked against the other table. You can probably use this to do what you want.