Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F00D04758D7 for ; Fri, 16 Aug 2002 11:52:21 -0400 (EDT) Received: from wolff.to (wolff.to [66.92.219.49]) by postgresql.org (Postfix) with SMTP id 2933A47546C for ; Fri, 16 Aug 2002 11:52:21 -0400 (EDT) Received: (qmail 16067 invoked by uid 500); 16 Aug 2002 15:59:11 -0000 Date: Fri, 16 Aug 2002 10:59:11 -0500 From: Bruno Wolff III To: Gary Stainburn Cc: pgsql-sql@postgresql.org Subject: Re: references definition to multi-field primary key Message-ID: <20020816155911.GA15999@wolff.to> Mail-Followup-To: Gary Stainburn , pgsql-sql@postgresql.org References: <200208161615.57616.gary.stainburn@ringways.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200208161615.57616.gary.stainburn@ringways.co.uk> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/250 X-Sequence-Number: 9096 On Fri, Aug 16, 2002 at 16:15:57 +0100, Gary Stainburn wrote: > > I only want the insert to work if prpid matches pgpid and prnozzle matches > pgnozzle. There are several typos in your sample that make it hard to know for sure what you want to do. However I suspect you just want to add a foreign key clause to your table definition. These can refer to more than one column (unlike references). My memory is that you need a matching unique index defined for the table you are referencing.