Re: 7.1.2 ERROR: UNIQUE constraint matching given keys for referenced table ...... - Mailing list pgsql-general

From lbayuk@mindspring.com (ljb)
Subject Re: 7.1.2 ERROR: UNIQUE constraint matching given keys for referenced table ......
Date
Msg-id 9h8nk4$2uf3$1@news.tht.net
Whole thread Raw
List pgsql-general
Lincy.Lin@LinuxInBox.Com wrote:
>HI !
>
>    Does anyone know what's my problem and how to resolve it ? Thanks.
>...
>>     Create Table DepartmentInfo
>>         (
>>...
>>             Department                Char(40)        Default ''
>>         );
>>...
>>     Create Table EmployeeInfo
>>         (
>>...
>>             Department            Char(40)        References
>> DepartmentInfo    (Department)
>>...
>>     ERROR:    UNIQUE constraint matching given keys for referenced table
>> "departmentinfo" not found

Make DepartmentInfo.Department a primary key. If not possible, make a
unique constraint on it. If it isn't unique, you shouldn't be referencing
it as a foreign key from EmployeeInfo.

pgsql-general by date:

Previous
From: "Thalis A. Kalfigopoulos"
Date:
Subject: RE: Red Hat to support PostgreSQL
Next
From: Tom Lane
Date:
Subject: Re: pgsql 7.1.2 server hanging...