Re: Log timestamps at higher resolution - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Log timestamps at higher resolution
Date
Msg-id 20181023191450.oarfc2a4gk6rm4w2@alvherre.pgsql
Whole thread Raw
In response to Re: Log timestamps at higher resolution  (David Fetter <david@fetter.org>)
Responses Re: Log timestamps at higher resolution  (David Fetter <david@fetter.org>)
List 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@fetter.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
withmilliseconds
 

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


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Log timestamps at higher resolution
Next
From: Jinho Jung
Date:
Subject: Re: Regarding query minimizer (simplifier)