Re: Changing a trigger function - Mailing list pgsql-novice

From Tom Lane
Subject Re: Changing a trigger function
Date
Msg-id 29319.1209051580@sss.pgh.pa.us
Whole thread Raw
In response to Re: Changing a trigger function  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
List pgsql-novice
"A. Kretschmer" <andreas.kretschmer@schollglas.com> writes:
> am  Thu, dem 24.04.2008, um 11:08:12 +0200 mailte Didier Gasser-Morlay folgendes:
>> What would happen if someone sends an update firing that trigger
>> whilst I am in the middle of updating it  via a create or update ? Do
>> I need to wait for this evening or can I safely runs the update of the
>> function ?

> All works within a TRANSACTION. If you change the function while the old
> version are running for an other transaction, the other transaction has
> the old version until the end.

Actually I believe that stuff works on SnapshotNow, meaning that the new
definition will be absorbed at the next call of the function after you
commit the CREATE OR REPLACE FUNCTION command.  Existing active calls
will continue to use the old function definition till they finish.

For plpgsql functions, there were some bugs in this in 8.1.0-8.1.6
and 8.2.0-8.2.1, so there's some risk of a problem if you're running one
of those versions.

            regards, tom lane

pgsql-novice by date:

Previous
From: Frank Bax
Date:
Subject: Re: restoring with pg_restore
Next
From: "Didier Gasser-Morlay"
Date:
Subject: Re: restoring with pg_restore