Re: pg_stat_replication in 9.3 - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_stat_replication in 9.3
Date
Msg-id 693.1410713729@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_stat_replication in 9.3  (Torsten Förtsch <torsten.foertsch@gmx.net>)
Responses Re: pg_stat_replication in 9.3  (Torsten Förtsch <torsten.foertsch@gmx.net>)
List pgsql-general
=?UTF-8?B?VG9yc3RlbiBGw7ZydHNjaA==?= <torsten.foertsch@gmx.net> writes:
> The replicas are far away, intercontinental far. I am not complaining
> that the replica looses the connection. What makes me wonder is that
> within a transaction, pg_stat_replication can forget rows but cannot
> acquire new ones. I'd think it should be either report the state at the
> beginning of the transaction like now() or the current state like
> clock_timestamp(). But currently it's reporting half the current state.

Are you watching the state in a loop inside a single plpgsql function?
If so, I wonder whether the problem is that the plpgsql function's
snapshot isn't changing.  From memory, marking the function VOLATILE
would help if that's the issue.

            regards, tom lane


pgsql-general by date:

Previous
From: Torsten Förtsch
Date:
Subject: Re: pg_stat_replication in 9.3
Next
From: Torsten Förtsch
Date:
Subject: Re: pg_stat_replication in 9.3