Update aborted if trigger function fails? - Mailing list pgsql-sql

From Carlos Moreno
Subject Update aborted if trigger function fails?
Date
Msg-id 425ADE3F.1090206@mochima.com
Whole thread Raw
Responses Re: Update aborted if trigger function fails?  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
Hi,

I just noticed this (odd?) behaviour, and it kind of
scares me.

For testing purposes, I put a deliberate syntax error;
this wouldn't happen in a real-life situation.  But what
if the error gets triggered by something that happens
later on?  say, if the trigger function uses a field
that later on gets dropped from the table -- something
that was working fine all of a sudden produces syntax
errors while executing the function

(I just verified, to see if the server would let me
drop a column that is being referenced by a function
invoked by an active trigger, and it did let me drop
it).

Isn't this a little fragile?  Is there something I
could do to avoid this situation?  Should trigger
functions be extremely simple as to guarantee that
an error would never happen?

Thanks,

Carlos
--



pgsql-sql by date:

Previous
From: "Dinesh Pandey"
Date:
Subject: How to Port Oracle's user defined "Package" into Postgres 8.0.1.
Next
From: "Moran.Michael"
Date:
Subject: PGCrypto: Realworld scenario and advice needed