Thread: After insert trigger and select
Hi. If I have after insert trigger on some table which updates some data in that same table, will be the select statement from some other client executed after all statements in that trigger? Thank you and kind regards, Rok
> If I have after insert trigger on some table which updates some data in > that same table, will be the select statement from some other client > executed after all statements in that trigger? > select statement is fired before commit ? ------------ pasman
On 02/16/2011 08:46 PM, pasman pasmański wrote: >> If I have after insert trigger on some table which updates some data in >> that same table, will be the select statement from some other client >> executed after all statements in that trigger? >> > select statement is fired before commit ? > ------------ > pasman For example let us say that trigger takes a long time to end. Are all statements in trigger executed before select from "outside" if select is called somewhere between executing of the trigger?
> -----Original Message----- > From: Rok Jaklič [mailto:rokj@rasca.net] > Sent: Wednesday, February 16, 2011 5:35 PM > To: pasman pasmański; pgsql-sql > Subject: Re: After insert trigger and select > > On 02/16/2011 08:46 PM, pasman pasmański wrote: > >> If I have after insert trigger on some table which updates > some data > >> in that same table, will be the select statement from some other > >> client executed after all statements in that trigger? > >> > > select statement is fired before commit ? > > ------------ > > pasman > For example let us say that trigger takes a long time to end. > Are all statements in trigger executed before select from > "outside" if select is called somewhere between executing of > the trigger? > With MVCC "writers" don't block "readers", and "readers" don't block "writers". Read PG docs on MVCC. Regards, Igor Neyman