SPI_execp() failed in RI_FKey_cascade_del()

From: "Papp, Gyozo" <pgerzson(at)freestart(dot)hu>
To: <pgsql-general(at)postgresql(dot)org>
Subject: SPI_execp() failed in RI_FKey_cascade_del()
Date: 2002-04-09 13:27:15
Message-ID: 007301c1dfca$44582620$01fdfea9@jaguar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

In my database there is a table "request" which is referenced
by a couple of other tables (about 4 or 5). Since quite frequently
I need to delete "request"s with any related data, I formulate
the foreign keys in the following way:

request_id INTEGER
CONSTRAINT n_request_id NOT NULL
CONSTRAINT f_request_id
REFERENCES request ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,

Here comes the definition of "request":

CREATE TABLE request (
request_id INTEGER
CONSTRAINT d_request_id DEFAULT nextval('s_request_id'::text)
CONSTRAINT p_request_id PRIMARY KEY,
label TEXT CONSTRAINT n_label NOT NULL,
description TEXT ,

announce_date DATE CONSTRAINT d_announce_date DEFAULT CURRENT_DATE,
submit_date DATE CONSTRAINT n_submit_date NOT NULL,

mail_subject TEXT ,
mail_message TEXT ,

organization_id INTEGER
CONSTRAINT n_organization_id NOT NULL
CONSTRAINT f_organization_id REFERENCES organization,
questionnare_id INTEGER
CONSTRAINT n_questionnare_id NOT NULL
CONSTRAINT f_questionnare_id REFERENCES questionnare,

status "char"
CONSTRAINT x_status
CHECK (upper(status) IN ('S','A','O','C','E')),
-- [S]aved, to-[A]nnounce, [O]pen = announced, [C]losed, [E]rror
participated INTEGER CONSTRAINT d_paricipated DEFAULT 0,
asked INTEGER ,

CONSTRAINT x_request_dates CHECK (submit_date > announce_date)
)
WITHOUT OIDS;

and when I execute the query "DELETE FROM request WHERE ..." I got
the following error message:

ERROR: SPI_execp() failed in RI_FKey_cascade_del()

My questions:
- Is it connected to permission somehow?
(delete revoked some of the related tables)
- What to do to get work the cascaded delete?

(with version 7.2.1 of postgres as a database superuser (postgres))

Gyozo Papp
- pgerzson(at)freestart(dot)hu

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Stanfield 2002-04-09 13:39:22 COPY command error in psql.
Previous Message Tom Lane 2002-04-09 13:14:59 Re: Hash Join vs Nested Loops in 7.2.1 ...