Foreign Key Question

From: Tuan Luu <tuanluu(at)gmx(dot)ch>
To: pgsql-admin(at)postgresql(dot)org
Subject: Foreign Key Question
Date: 2004-02-09 07:59:12
Message-ID: 40273DD0.6030004@gmx.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Example:

Table 1:
Inventory, Productnr, Productserial
(PK Inventory, Prouctnr)

Table 2:
Pruductnr, Produktdesc, Productversion
(PK Productnr; FK Productnr)

This Construct gives me an error during the creation in Postgresql
(saying there is no unique constraint matching given keys for referenced
table xxxx). The Primary Key in table 1 consists of two columns. In the
second table there is a foreign key refencing to the first table.

A unique constraint doesn't make sense on table one. Am I missing
something here?
Thanks for any answer
Tuan

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message scott.marlowe 2004-02-09 16:58:34 Re: hanging for 30sec when checkpointing
Previous Message Tom Lane 2004-02-09 03:23:26 Re: statistics buffer is full