Re: Referencing multiple primary keys from a single table. - Mailing list pgsql-novice

From Stephan Szabo
Subject Re: Referencing multiple primary keys from a single table.
Date
Msg-id 20030922150356.K11175@megazone.bigpanda.com
Whole thread Raw
In response to Referencing multiple primary keys from a single table.  (Daniel Staal <DStaal@usa.net>)
Responses Re: Referencing multiple primary keys from a single
List pgsql-novice
On Mon, 22 Sep 2003, Daniel Staal wrote:

>
> What is the best way to reference (use as foreign key) a table with
> multiple primary keys?
>
> Here's what I have:
> Table1:
> field1
> field2
> field3
> ...
> primary key (field1, field2, field3)

This isn't multiple primary keys, it's a single primary key with
3 columns.

> Then I have another table that needs to reference Table1 with a
> foreign key.  What I really want to do is:
> Table2:
> field1 Primary key
> field2 references table1

What are you actually trying to do here?  field2 is a single column
and you're referencing a 3 column key, so I'm not sure what behavior
you're looking for.

pgsql-novice by date:

Previous
From: Daniel Staal
Date:
Subject: Referencing multiple primary keys from a single table.
Next
From: Daniel Staal
Date:
Subject: Re: Referencing multiple primary keys from a single