Update aborted if trigger function fails?

From: Carlos Moreno <moreno(at)mochima(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Update aborted if trigger function fails?
Date: 2005-04-11 20:29:51
Message-ID: 425ADE3F.1090206@mochima.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
--

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dan Feiveson 2005-04-11 20:38:13 OpenFTS
Previous Message Tom Lane 2005-04-11 16:42:29 Re: pg 8.0.1-r3 killls pgadmin3 and phppgadmin