Thread: triggered data change violation

triggered data change violation

From
Cedar Cox
Date:
ERROR:  triggered data change violation on relation "tblstsc2options"

What is this?  It doesn't happen unless I'm in a transaction.  I'm
INSERTing a record and then DELETEing it (in the same transaction) and on
delete I get this error.  If I commit and begin a new transaction before
the delete everything is fine.  Is it something my trigger causing?  I
don't have any UPDATE, INSERT, or DELETE statements in my trigger (and I
am returning old on delete).

Thanks,
-Cedar




Re: triggered data change violation

From
Tom Lane
Date:
Cedar Cox <cedarc@visionforisrael.com> writes:
> ERROR:  triggered data change violation on relation "tblstsc2options"

> What is this?  It doesn't happen unless I'm in a transaction.  I'm
> INSERTing a record and then DELETEing it (in the same transaction) and on
> delete I get this error.

That's exactly what it's unhappy about ... but I'm not too clear on
just *why* that should be considered an uncool thing to do when you
have an AFTER trigger on the table.  You're asking in the wrong list
though; try pgsql-hackers or pgsql-sql to see if someone knows why
this is bad.
        regards, tom lane