Exception When Insert Followed By Delete In PL/PGSQL - Mailing list pgsql-sql

From
Subject Exception When Insert Followed By Delete In PL/PGSQL
Date
Msg-id 200111260140.35e7@lh00.opsion.fr
Whole thread Raw
Responses Re: Exception When Insert Followed By Delete In PL/PGSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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







pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Sequence permission suggestion
Next
From: Tom Lane
Date:
Subject: Re: Exception When Insert Followed By Delete In PL/PGSQL