Re: I get an error with Foreign Keys - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: I get an error with Foreign Keys
Date
Msg-id Pine.BSF.4.21.0011301432001.48235-100000@megazone23.bigpanda.com
Whole thread Raw
In response to I get an error with Foreign Keys  (Brian Powell <brian@owlscreech.com>)
List pgsql-sql
On Thu, 30 Nov 2000, Brian Powell wrote:

> I have around 40 tables defined, many relying on data in others so I have
> foreign key constraints.  However, whenever I try to delete from any table,
> I get:
> 
> ERROR:  SPI_execp() failed in RI_FKey_cascade_del()
> 
> What generates this?  I need assistance in knowing where to begin.  I
> checked again, and I could not find any circular foreign key constraints...

Hmm, that might mean that the statement being generated inside the
trigger is incorrect in some way that isn't being reported.  Can you 
send a schema dump of your tables and I'll see if I can reproduce it.

BTW: The code in question is probably in src/backend/utils/ri_*.c [I
can't remember the exact ending of the filename].  It should be building
a statement and attempting to execute it using the SPI interface and
it looks like the execute is failing I'd guess by the message.



pgsql-sql by date:

Previous
From: Brian Powell
Date:
Subject: I get an error with Foreign Keys
Next
From: Tom Lane
Date:
Subject: Re: String function page incorrect?