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

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 (view raw or flat)
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

pgsql-novice by date

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

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