Primary and Foreign Key?

From: "A(dot) Banks" <abanks(at)insightbb(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Primary and Foreign Key?
Date: 2005-09-22 00:46:10
Message-ID: KBEKKNMFLELKGIADDEPEOELICAAA.abanks@insightbb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tjibbe 2005-09-22 09:43:02 Example stored function generating and returning XML
Previous Message Oliver Elphick 2005-09-21 13:18:31 Re: QUERY A PSQL DB USING CRONTAB