Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 2BCB7475F34 for ; Mon, 10 Jun 2002 12:30:57 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id CE850476CF2 for ; Mon, 10 Jun 2002 11:58:03 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 6BE80D60D; Mon, 10 Jun 2002 08:58:00 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 5F9045C01; Mon, 10 Jun 2002 08:58:00 -0700 (PDT) Date: Mon, 10 Jun 2002 08:58:00 -0700 (PDT) From: Stephan Szabo To: Matt Cc: Subject: Re: multiple primary keys and reference In-Reply-To: <3D0110C1.5020908@weilpublishing.com> Message-ID: <20020610085457.L67911-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200206/112 X-Sequence-Number: 8077 On Fri, 7 Jun 2002, Matt wrote: > I have a table, OrderDetail, with two primary keys OrderID and ProductID I assume you mean it has a primary key with two columns. > > I want another table, Claims, to reference the primary keys of > OrderDetail so that the pair has to match between table not just one > attrib. I can't figure out how to do this from the docs I have. can > anyone help? thankyou in advance If I understand what you want, use the table constraint form of foreign keys: create table a (a int, b int, primary key(a,b)); create table b (a int, b int, foreign key(a,b) references a);