UNIQUE constraint matching given keys for referenced table "employee" not found

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: UNIQUE constraint matching given keys for referenced table "employee" not found
Date: 2002-08-08 23:06:04
Message-ID: 20020808230604.60619.qmail@web20807.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thought I understood this, but evidently not...
couldn't find anything in the docs or archives that
helped me, either.

Trying to add a new table, then referencing a number
of other tables to a field in the new table. Table
definition:

create table "employee" (
"emp_id" integer default
nextval('employee_emp_id_key'::text) not null,
"emp_num" text,
"first_name" text not null,
"middle_name" text,
"last_name" text not null,
"suffix" text,
"salutation" text,
"ssn" text,
"sex" text,
"race_id" text,
"dob" date,
"review" text,
"comment" text,
"history" text,
"date_entered" date,
"marital_status" text,
"ond3" boolean,
constraint "employee_pkey" primary key
("emp_id"),
constraint "emp_num_key" unique (emp_num)
);

personnel_benefits=# \i employees.dump
You are now connected as new user jeck.
psql:employees.dump:31: NOTICE: CREATE TABLE/PRIMARY
KEY will create implicit index 'employee_pkey' for
table 'employee'
psql:employees.dump:31: NOTICE: CREATE TABLE/UNIQUE
will create implicit index 'emp_num_key' for table
'employee'
CREATE
personnel_benefits=# alter table emp_insurance add
constraint ei_emp_fk foreign key (emp_no) references
employee (emp_no);
NOTICE: ALTER TABLE ... ADD CONSTRAINT will create
implicit trigger(s) for FOREIGN KEY check(s)
ERROR: UNIQUE constraint matching given keys for
referenced table "employee" not found
personnel_benefits=#

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-08-08 23:13:59 Re: inet <<= and indexes
Previous Message Roderick A. Anderson 2002-08-08 22:32:58 Re: [HACKERS] postgresql performance tuning document ?