Re: Foreign key - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: Foreign key
Date
Msg-id 20050327163328.GG9280@wolff.to
Whole thread Raw
In response to Foreign key  (<ASAKALAL@bouyguestelecom.fr>)
List pgsql-sql
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.


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgre: 8.0.1 Create Table insde a function gives strange error at execution time
Next
From: Mike Rylander
Date:
Subject: Re: detaching triggers