Foreign Key

From: "Bob Pawley" <rjpawley(at)shaw(dot)ca>
To: "Postgresql" <pgsql-general(at)postgresql(dot)org>
Subject: Foreign Key
Date: 2010-04-22 22:24:56
Message-ID: DD4E2D20E9D14B95B31A8EA933686FC3@desktop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

I don't understand what the following error means.

I am trying to add a foreign key to table image, that holds column device_id. This is to be controlled by column devices_id in table devices.

ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address) REFERENCES addresses (address) MATCH FULL;

ERROR: insert or update on table "image" violates foreign key constraint "deviceidfk"
DETAIL: Key (device_id)=(4022) is not present in table "devices".

Help appreciated.

Bob

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-04-22 22:28:50 Re: PSQL segmentation fault after setting host
Previous Message Greg Smith 2010-04-22 21:53:02 Re: Creating indexes?