Re: Finer grain log timestamps

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Finer grain log timestamps
Дата
Msg-id 3920623.1655151762@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Finer grain log timestamps  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Finer grain log timestamps  (David Fetter <david@fetter.org>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: pltcl crash on recent macOS
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pltcl crash on recent macOS