Re: Log timestamps at higher resolution

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, 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-24 22:25:34
Message-ID: 20181024222534.GN6049@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 24, 2018 at 03:17:09PM +0100, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > On 2018-Oct-24, David Fetter wrote:
> >> For another, having separate letter rather than number modifiers as
> >> printf("%03d") does, is just lousy API design.
>
> > I don't think the API is lousy as all that, but a further improvement to
> > allow a precision specifier might be a worthy feature addition -- say
> > %.6t or such (where %m would have the same meaning as %.3t).
>
> +1. I think the patch as it stands is way too influenced by the purely
> chance factor that "milli" and "micro" have the same initial letter in
> English. David would never have submitted it in this form if that weren't
> true; but that doesn't make either resolution the right answer for
> everyone. And I do not want to have this discussion again in ten years
> when somebody starts moaning that microsecond resolution is so last
> century. Let's put in a number so that the format-string API can stay the
> same as the required resolution moves.

Digging a teensy bit deeper, I noticed that there's already a
"padding" (space padding, if I understand correctly) system for parts
of the log_line_prefix specification including %m. Did we get painted
into a corner here back in 9.4, when the padding feature was added?
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4334639f4bb9fb88c13b8dd5faca22b207248504

Strangely, there were no tests that came with that either. David, did
you mean to expand it past space padding, or...?

Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Banck 2018-10-24 23:00:29 Re: BUG #15448: server process (PID 22656) was terminated by exception 0xC0000005
Previous Message Andres Freund 2018-10-24 21:38:54 Re: notice processors for isolationtester