Timezone for %t log_line_prefix

Started by Andreas Pflugover 21 years ago2 messages
#1Andreas Pflug
pgadmin@pse-consulting.de

If %t is used in log_line_prefix, win32's strftime will print a very
long timezone information, e.g. "W. Europe Daylight Time" where Linux
would write "UTC". This makes the timestamp consuming more than half of
an average line length.
Do we have alternatives to the long form? Do we need the timezone
information at all? We know already it's the server's time. Another
alternative would be a short timestamp (%t vs. %T) to have both.

Regards,
Andreas

#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Andreas Pflug (#1)
Re: Timezone for %t log_line_prefix

Well, I see this in pgtz.c:

{"Eastern Standard Time", "Eastern Daylight Time",
"US/Eastern"}, /* (GMT-05:00) Eastern Time (US & Canada) */

Can't we use this to map to slightly shorter names?

---------------------------------------------------------------------------

Andreas Pflug wrote:

Tom Lane wrote:

Does Windows' strftime have any short zone name %-spec? Seems like a
quick #ifdef WIN32 to use a more compact zone name would be the best
solution.

I already checked; unfortunately there's no short zone option. %z and %Z
give identical output.

I'd be inclined to leave out the zone field *on Windows only* if there
is no %-spec that uses something more reasonable. I don't think this
problem justifies adding more %-options to log_line_prefix.

I don't have a problem with either way, but it appears desirable if
there would be a log_line_prefix option that gives identical result on
all systems.

Regards,
Andreas

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073