Re: I get an error with Foreign Keys

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Brian Powell <brian(at)owlscreech(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: I get an error with Foreign Keys
Date: 2000-11-30 22:35:36
Message-ID: Pine.BSF.4.21.0011301432001.48235-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-11-30 23:05:42 Re: String function page incorrect?
Previous Message Trond Eivind =?iso-8859-1?q?Glomsr=d8d?= 2000-11-30 21:11:39 Re: Can PostGreSQL handle 100 user database?