Skip site navigation (1) Skip section navigation (2)

Primary and Foreign Key?

From: "Announce" <truthhurts(at)insightbb(dot)com>
To: "PostgreSQL SQL List" <pgsql-sql(at)postgresql(dot)org>
Subject: Primary and Foreign Key?
Date: 2005-09-23 01:13:35
Message-ID: KBEKKNMFLELKGIADDEPEMEMICAAA.truthhurts@insightbb.com (view raw or flat)
Thread:
Lists: pgsql-sql
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


Responses

pgsql-sql by date

Next:From: Russell SimpkinsDate: 2005-09-23 01:34:11
Subject: Re: Primary and Foreign Key?
Previous:From: Josh BerkusDate: 2005-09-22 22:10:23
Subject: Re: Using descriptor areas to insert

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group