Re: Changing a trigger function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Changing a trigger function
Дата
Msg-id 29319.1209051580@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Changing a trigger function  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список 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 по дате отправления:

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: restoring with pg_restore
Следующее
От: "Didier Gasser-Morlay"
Дата:
Сообщение: Re: restoring with pg_restore