Re: Triggers in pgadmin query tools - Mailing list pgadmin-support

From Guillaume Lelarge
Subject Re: Triggers in pgadmin query tools
Date
Msg-id 4D905269.7050108@lelarge.info
Whole thread Raw
In response to Re: Triggers in pgadmin query tools  (Francois Legrand <legrand@lpnhe.in2p3.fr>)
Responses Re: Triggers in pgadmin query tools
List pgadmin-support
Le 28/03/2011 10:52, Francois Legrand a écrit :
> Hi all,
> Are triggers are fired "only once by connection" ?

They are fired as many times as needed.

> Here is my point.
> 
> I found a really strange behaviour of the pgadmin II with triggers.
> I activated the detailed logs on my server thus I could monitor
> everything, and the point is the following :
> 
> 1) I open the query tool
> 2) I do a first insert in my table ==> The trigger is fired
> 3) I do a second (and more) insert in my table ==> The trigger is NOT fired
> 4) I close the query tool and open it again and do an insert ==> the
> trigger is fired
> 
> Thus it appears that when I run several inserts from the query tool, the
> trigger is fired the first time but not anymore after.
> I found that this is exactly the same if I add lines directly from the
> "Edit data" window. The first line I add fire the trigger, but the
> others no.
> 
> Moreover, it is also the same from the psql tool.
> I open psql, do an insert : the trigger is fired. But if I do a second
> insert, the trigger is not fired.
> 
> *Thus it appears that triggers are fired "only once by connection" !*
> 
> I found that someone had the same problem
> (http://www.mail-archive.com/pgsql-general@postgresql.org/msg23094.html)
> 

This mail was sent in 2001, that's only ten years back. Things have
changed since (btw, I'm not saying it worked this way at this time).

> Is that normal ? Is it possible to fix that in the server configuration ?
> 

There's no configuration that would explain that behaviour. My guess is
that you have an issue with your trigger function. It would help to know
its content, and your PostgreSQL release.

BTW, this is more a PostgreSQL question, not a pgAdmin one.


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com


pgadmin-support by date:

Previous
From: Francois Legrand
Date:
Subject: Re: Triggers in pgadmin query tools
Next
From: Francois Legrand
Date:
Subject: Re: Triggers in pgadmin query tools