Re: Problem with background worker

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Marc Cousin <cousinmarc(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problem with background worker
Date: 2013-04-10 16:38:57
Message-ID: 20130410163857.GO3751@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marc Cousin escribió:
> On 20/03/2013 16:33, Alvaro Herrera wrote:

> >Ah. The reason for this problem is that the statement start time (which
> >also sets the transaction start time, when it's the first statement) is
> >set by postgres.c, not the transaction-control functions in xact.c. So
> >you'd need to add a SetCurrentStatementStartTimestamp() call somewhere
> >in your loop.
> >
>
> Yes, that works. Thanks a lot !
>
> Maybe this should be added to the worker_spi example ?

Done in
http://git.postgresql.org/pg/commitdiff/e543631f3c162ab5f6020b1d0209e0353ca2229a

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2013-04-10 16:39:59 Re: Behaviour of bgworker with SIGHUP
Previous Message Dang Minh Huong 2013-04-10 14:56:27 Re: replication_timeout not effective