Foreign key violation - Mailing list pgsql-novice

From Scott Ford
Subject Foreign key violation
Date
Msg-id F7653F642E0F8E4F9F5D6FD8ED0159AB011E7AD6@CX43.800onemail.com
Whole thread Raw
In response to Re: Trigger question  (Terry Lee Tucker <terry@chosen-ones.org>)
List pgsql-novice
I'm getting an error from within a stored procedure being called from
Coldfusion that is telling me that a foreign key value is not present in
the parent table, but it clearly is.

This happens infrequently, but seems to continue to happen despite
restarts.

Detailed message:

EXCEPTION MESSAGE: Error Executing Database Query.
DETAIL: [Macromedia][SequeLink JDBC Driver][ODBC Socket]ERROR: insert or
update on table "entity_documentation" violates foreign key constraint
"entity_documentation_distributor_id_fkey"
Key (distributor_id)=(87) is not present in table "distributors".;
Error while executing the query
NATIVEERRORCODE: 7
SQLSTATE: 23503
QUERYERROR: [Macromedia][SequeLink JDBC Driver][ODBC Socket]ERROR:
insert or update on table "entity_documentation" violates foreign key
constraint "entity_documentation_distributor_id_fkey"
Key (distributor_id)=(87) is not present in table "distributors".;
Error while executing the query
ERRORCODE: 23503

TIA!

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: data type of string literal
Next
From: "Nicholas Hemley"
Date:
Subject: postgres 8.3 (Centos 5.1) create tablespace problem