Re: 7.1.2 ERROR: UNIQUE constraint matching given keys for referenced table ......

From: lbayuk(at)mindspring(dot)com (ljb)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: 7.1.2 ERROR: UNIQUE constraint matching given keys for referenced table ......
Date: 2001-06-26 01:13:40
Message-ID: 9h8nk4$2uf3$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lincy(dot)Lin(at)LinuxInBox(dot)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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-06-26 01:45:54 Re: pgsql 7.1.2 server hanging...
Previous Message Thalis A. Kalfigopoulos 2001-06-26 00:21:47 RE: Red Hat to support PostgreSQL