Обсуждение: After insert trigger and select

Поиск
Список
Период
Сортировка

After insert trigger and select

От
Rok Jaklič
Дата:
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


Re: After insert trigger and select

От
pasman pasmański
Дата:
> 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


Re: After insert trigger and select

От
Rok Jaklič
Дата:
  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?



Re: After insert trigger and select

От
"Igor Neyman"
Дата:

> -----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