Re: Foreign key

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: ASAKALAL(at)bouyguestelecom(dot)fr
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Foreign key
Date: 2005-03-27 16:33:28
Message-ID: 20050327163328.GG9280@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Mar 25, 2005 at 16:31:16 +0100,
ASAKALAL(at)bouyguestelecom(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2005-03-27 16:51:15 Re: (non)zero function
Previous Message Mike Rylander 2005-03-27 16:20:27 Re: detaching triggers