Re: [TRIGGER] Returning values from BEFORE UPDATE trigger, without using them

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Torsten Zühlsdorff <foo(at)meisterderspiele(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [TRIGGER] Returning values from BEFORE UPDATE trigger, without using them
Date: 2010-07-27 20:50:24
Message-ID: 13845.1280263824@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

=?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= <foo(at)meisterderspiele(dot)de> writes:
> I have defined an BEFORE UPDATE trigger. The trigger catch every update,
> change some columns of the new row, make an insert of the new row and
> returns null to abort the update.

Why in the world would you do that? Just return the modified row from
the trigger and let the update proceed normally.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Torsten Zühlsdorff 2010-07-28 06:45:02 Re: [TRIGGER] Returning values from BEFORE UPDATE trigger, without using them
Previous Message Oliveiros d'Azevedo Cristina 2010-07-27 10:37:49 Re: grouping subsets