X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B10B2D1C967 for ; Mon, 9 Feb 2004 07:59:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 11983-03 for ; Mon, 9 Feb 2004 03:59:33 -0400 (AST) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id A3571D1D55F for ; Mon, 9 Feb 2004 03:59:25 -0400 (AST) Received: (qmail 30898 invoked by uid 65534); 9 Feb 2004 07:59:15 -0000 Received: from adsl-137-237-bs2.tiscali.ch (EHLO gmx.ch) (212.254.137.237) by mail.gmx.net (mp014) with SMTP; 09 Feb 2004 08:59:15 +0100 X-Authenticated: #8161240 Message-ID: <40273DD0.6030004@gmx.ch> Date: Mon, 09 Feb 2004 08:59:12 +0100 From: Tuan Luu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Foreign Key Question Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/182 X-Sequence-Number: 12356 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