From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: David Fetter <david@fetter.org>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Subject: Re: Finer grain log timestamps
Date: Mon, 13 Jun 2022 16:22:42 -0400
Message-ID: <3920623.1655151762@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoYx_2v3wGzqWWNuC05bDOYyHubODfFUoj8nrvSajRjCYA@mail.gmail.com>
References: <20220508204451.GC11333@fetter.org>
<CA+TgmoYx_2v3wGzqWWNuC05bDOYyHubODfFUoj8nrvSajRjCYA@mail.gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> On Sun, May 8, 2022 at 4:45 PM David Fetter <david@fetter.org> wrote:
>> Please find attached a patch to change the sub-second granularity of
>> log timestamps from milliseconds to microseconds.
> Why is this a good idea?
I can imagine that some people would have a use for microsecond
resolution in log files, and I can also imagine that as machines
get faster more people will want that. As against that, this
will bloat log files by a non-microscopic amount, and it's pretty
likely to break some log-scanning tools too. It's unclear to me
that that's a tradeoff we should force on everyone.
I think a proposal less likely to have push-back would be to invent
a different log_line_prefix %-escape to produce microseconds.
Sadly, "%u" is already taken, but perhaps we could use "%U"?
A different line of thought is to extend %t to provide a precision
field a la sprintf, so that for example "%.3t" is equivalent to
"%m" and "%.6t" does what David wants, and we won't have to
search for a new escape letter when the day arrives that
somebody wants nanosecond resolution. The same could be done
with %n, avoiding the need to find a different escape letter
for that.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, david@fetter.org
Subject: Re: Finer grain log timestamps
In-Reply-To: <3920623.1655151762@sss.pgh.pa.us>
* 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