X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 22ECED9FC2 for ; Wed, 21 Sep 2005 21:45:17 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55519-03 for ; Thu, 22 Sep 2005 00:45:10 +0000 (GMT) Received: from sccimhc92.asp.att.net (sccimhc92.asp.att.net [63.240.76.166]) by svr1.postgresql.org (Postfix) with ESMTP id 02E12DA005 for ; Wed, 21 Sep 2005 21:45:11 -0300 (ADT) Received: from krunk (12-202-107-96.client.insightbb.com[12.202.107.96]) by sccimhc92.asp.att.net (sccimhc92) with SMTP id <20050922004513i9200qlnhne>; Thu, 22 Sep 2005 00:45:14 +0000 From: "A. Banks" To: Subject: Primary and Foreign Key? Date: Wed, 21 Sep 2005 19:46:10 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/150 X-Sequence-Number: 14458 I have the following related tables: PEOPLE -------------- peopleid pkey, name, etc GROUPS ------------- groupid pkey, description, etc PEOPLEGROUPS ------------------- peopleid pkey/fkey, groupid pkey/fkey What is the CORRECT way (in Postgres) to define the PEOPLEGROUPS table so that it has both the double primary key AND still acts as a foreign key for people.peopleid and groups.groupid? Can i specify both or is this not necessary? Any suggestions would be appreciated. Thanks! -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.3/107 - Release Date: 9/20/2005