X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A55D053604 for ; Sun, 27 Mar 2005 17:17:02 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 52251-03 for ; Sun, 27 Mar 2005 16:16:56 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 5D0B3535AC for ; Sun, 27 Mar 2005 17:16:56 +0100 (BST) Received: (qmail 10980 invoked by uid 500); 27 Mar 2005 16:33:28 -0000 Date: Sun, 27 Mar 2005 10:33:28 -0600 From: Bruno Wolff III To: ASAKALAL@bouyguestelecom.fr Cc: pgsql-sql@postgresql.org Subject: Re: Foreign key Message-ID: <20050327163328.GG9280@wolff.to> Mail-Followup-To: Bruno Wolff III , ASAKALAL@bouyguestelecom.fr, pgsql-sql@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/359 X-Sequence-Number: 20838 On Fri, Mar 25, 2005 at 16:31:16 +0100, ASAKALAL@bouyguestelecom.fr wrote: > > When i add table with foreign key in my database, this error return : < > number of referencing and referenced colums for foreign key disagree>. > > How resolve this problem ? Besides what Mike said, one other thing to remember is that if you don't specify columns in the referenced table, the primary key of that table is used, NOT columns with names matching those of the referencing table. In cases like this it have helped if you had copied and pasted an example displaying the problem in addition to the error message.