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