Skip site navigation (1) Skip section navigation (2)

Re: Changing a trigger function

From: Terry Lee Tucker <terry(at)chosen-ones(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Changing a trigger function
Date: 2008-04-24 09:23:19
Message-ID: 200804240523.19497.terry@chosen-ones.org (view raw or flat)
Thread:
Lists: pgsql-novice
On Thursday 24 April 2008 05:08, Didier Gasser-Morlay wrote:
> I have found a nasty bug in one of the trigger function I did put into
> production a couple of days ago. I have a fix for it but wonder if I
> can put it into the production database with users connected on it.
>
> 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 ?
>
> I know that several other databases would reject the update (Sybase,
> Firebird for example) but I am too new to PostgresSQL to know what
> would happen in such a situation
>
>
>
> Didier

You do not have to wait to load the trigger. If some process accesses the 
trigger in the midst of your loading it, it will be handled in the same way 
as someone reading a set of records from a table while another is inserting 
or updating records in the same table; that is, the data as it existed before 
the transaction started would be used. Loading the trigger will behave the 
same way. We've done this many times.
-- 
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812  Fax: (336) 372-6812  Cell: (336) 404-6987
terry(at)turbocorp(dot)com
www.turbocorp.com

In response to

pgsql-novice by date

Next:From: A. KretschmerDate: 2008-04-24 09:28:03
Subject: Re: Limiting the number of connections for one user
Previous:From: A. KretschmerDate: 2008-04-24 09:22:44
Subject: Re: Changing a trigger function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group