From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Coordinate log_line_prefix options 'm' and 'n' to share a timeva
Date: Mon, 07 Sep 2015 22:41:38 +0000
Message-ID: <E1ZZ56Y-00067Y-HK@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Coordinate log_line_prefix options 'm' and 'n' to share a timeval.
Commit f828654e introduced the 'n' option, but it invoked
gettimeofday() independently of the 'm' option. If both options were
in use (or multiple 'n' options), or if 'n' was in use along with
csvlog, then the reported times could be different for the same log
message.
To fix, initialize a global variable with gettimeofday() once per log
message, and use that for both formats.
Don't bother coordinating the time for the 't' option, which has much
lower resolution.
Per complaint by Alvaro Herrera.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/b1e1862a123b6904d51fd0a607e30f5832bf9a1f
Modified Files
--------------
src/backend/utils/error/elog.c | 32 +++++++++++++++++++++++---------
1 file changed, 23 insertions(+), 9 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: jdavis@postgresql.org
Subject: Re: pgsql: Coordinate log_line_prefix options 'm' and 'n' to share a timeva
In-Reply-To: <E1ZZ56Y-00067Y-HK@gemulon.postgresql.org>
References: <E1ZZ56Y-00067Y-HK@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox