Re: Log timestamps at higher resolution

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Log timestamps at higher resolution
Date: 2018-10-23 19:14:50
Message-ID: 20181023191450.oarfc2a4gk6rm4w2@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Oct-23, David Fetter wrote:

> On Wed, Oct 24, 2018 at 08:00:24AM +1300, Thomas Munro wrote:
> > On Wed, Oct 24, 2018 at 7:51 AM David Fetter <david(at)fetter(dot)org> wrote:
> > > Per gripes I've been hearing with increasing frequency, please find
> > > attached a patch that implements $Subject. It's microsecond resolution
> > > because at least at the moment, nanosecond resolution doesn't appear
> > > to be helpful in this context.
> >
> > Wouldn't you want to choose a new letter or some other way to make
> > existing format control strings do what they always did?
>
> I hadn't because I'd looked at the existing format as merely buggy in
> lacking precision, although I guess with really fussy log processors,
> this change could break things.
>
> Have you seen processors like that in the wild?

pgbadger does this:
'%m' => [('t_mtimestamp', '(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\.\d+(?: [A-Z\+\-\d]{3,6})?')], # timestamp with milliseconds

which should cope with however many digits there are (\d+).
But I would expect others to be less forgiving ...

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jinho Jung 2018-10-23 19:15:03 Re: Regarding query minimizer (simplifier)
Previous Message David Fetter 2018-10-23 19:10:08 Re: Log timestamps at higher resolution