Exception When Insert Followed By Delete In PL/PGSQL

From: <cnliou(at)eurosport(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Exception When Insert Followed By Delete In PL/PGSQL
Date: 2001-11-26 01:40:53
Message-ID: 200111260140.35e7@lh00.opsion.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello!

The exception is raised by PL/PGSQL in version
PostgreSQL 7.1.3.:

triggered data change violation on relation
"mastertable"

The code having problem:

DECLARE
n smallint;
BEGIN
insert into MasterTable values...;
SELECT COUNT(*) INTO n FROM DetailTable,MasterTable
WHERE DetailTable.KeyField = MasterTable.KeyField;
IF n = 0 THEN
DELETE FROM MasterTable WHERE ...; --exception
raised
END IF;
END;

--------------------------------------------------------
You too can have your own email address from Eurosport.
http://www.eurosport.com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-11-26 01:53:07 Re: Exception When Insert Followed By Delete In PL/PGSQL
Previous Message Tom Lane 2001-11-26 01:19:22 Re: Sequence permission suggestion