Re: how to show time zone with numerical offset in CSV log?

From: Michael Zoet <Michael(dot)Zoet(at)zoet(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: how to show time zone with numerical offset in CSV log?
Date: 2015-09-22 15:16:38
Message-ID: 20150922171638.Horde.SPoTc52Fjd3mh6GhBijD0Q1@server06.zoet.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


----- Nachricht von Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> ---------
Datum: Tue, 22 Sep 2015 07:46:24 -0700

>> Zone names: Time zone names ('z') cannot be parsed.
>
> Some more digging found that DateTimeFormat can deal with Z which
> is either the offset or the timezone id, in particular as ZZZ.
>
> http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html
>
> Zone: 'Z' outputs offset without a colon, 'ZZ' outputs the offset
> with a colon, 'ZZZ' or more outputs the zone id.

That's why I am asking "how to get the numerical offset printed in the
log files". Logstash can parse the numerical value. Otherwise I will
always have a parsing error in Logstash. We could live with this but
if it is possible I'd like to change this on the Postgres level. But I
never thought that this is much more complicated than expected.

>
> The timezone names in Postgres are available from:
>
> select * from pg_timezone_names ;
>
> So in addition to Tom's suggestion, you might try setting the
> log_timezone to a name. Examples: Europe/Brussels for CEST, Etc/UTC
> for UTC
>

As far as I understand the log_timezone configuration option, it will
always print me the name if I use a name for the time zone. And that
is the no go for Logstash. So I really need a numerical value to parse
it with Logstash.

Michael

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-09-22 15:22:09 Re: how to show time zone with numerical offset in CSV log?
Previous Message Michael Zoet 2015-09-22 15:05:21 Re: how to show time zone with numerical offset in CSV log?