Re: PATCH: numeric timestamp in log_line_prefix

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: PATCH: numeric timestamp in log_line_prefix
Дата
Msg-id 1441660557.10365.28.camel@jeff-desktop
обсуждение исходный текст
Ответ на Re: PATCH: numeric timestamp in log_line_prefix  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: PATCH: numeric timestamp in log_line_prefix  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
> I wonder about this separate gettimeofday() call.  We already have
> formatted_log_time which is used for CSV logs and freeform log lines
> (stderr/syslog); if we introduce a separate gettimeofday() call here,
> and the user has %n in freeform log and CSV logging is active, the
> timings will diverge occasionally.
> 
> Maybe I'm worrying over nothing, because really what use case is there
> for having the two log formats enabled at the same time?  Yet somebody
> went some lengths to ensure they are consistent; I think we should do
> likewise here.

We now have three time-related options[1]: t, m, and n; and they each
acquire the time independently. Are you suggesting that we make all
three consistent, or only m and n?

The cleanest fix would be for the global variable to only hold the
timeval, and then format it once for the CSV log (always 'm' format) and
once for the regular log ('m', 'n', or 't'). If the regular log uses
'm', that would be some wasted cycles formatting it the same way twice.
Is it worth a little extra ugliness to cache both the timeval and the
formatted string?

Regards,Jeff Davis

[1] As of minutes ago, after I missed your message by a few minutes.





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

Предыдущее
От: Petr Jelinek
Дата:
Сообщение: Re: creating extension including dependencies
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: PATCH: numeric timestamp in log_line_prefix