X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 38FDDD7E41 for ; Thu, 22 Sep 2005 22:13:13 -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 77087-05 for ; Fri, 23 Sep 2005 01:13:08 +0000 (GMT) Received: from sccimhc92.asp.att.net (sccimhc92.asp.att.net [63.240.76.166]) by svr1.postgresql.org (Postfix) with ESMTP id DB2F6D7E26 for ; Thu, 22 Sep 2005 22:13:09 -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 <20050923011308i9200ql4ove>; Fri, 23 Sep 2005 01:13:13 +0000 From: "Announce" To: "PostgreSQL SQL List" Subject: Primary and Foreign Key? Date: Thu, 22 Sep 2005 20:13:35 -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) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal 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/219 X-Sequence-Number: 22766 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.4/109 - Release Date: 9/21/2005