Postgresql logfilename and times in GMT - not EST

Started by Bryan Montgomeryover 13 years ago4 messagesgeneral
Jump to latest
#1Bryan Montgomery
monty@english.net

We have a test 9.2.0 db running on openSuse 12.2. When I select now() I get
the correct timezone and date back (-5 hours).
When I do date at the os prompt, I get the right timezone back.

I changed postgres.conf to have timezone = 'EST' and restarted postgres.
However the log file is still 5 hours ahead. What gives? Not the end of the
world but a bit annoying.

Bryan.

#2Lonni J Friedman
netllama@gmail.com
In reply to: Bryan Montgomery (#1)
Re: Postgresql logfilename and times in GMT - not EST

On Tue, Dec 4, 2012 at 1:59 PM, Bryan Montgomery <monty@english.net> wrote:

We have a test 9.2.0 db running on openSuse 12.2. When I select now() I get
the correct timezone and date back (-5 hours).
When I do date at the os prompt, I get the right timezone back.

I changed postgres.conf to have timezone = 'EST' and restarted postgres.
However the log file is still 5 hours ahead. What gives? Not the end of the
world but a bit annoying.

you need to set log_timezone . This is a new 'feature' in 9.2 that
annoyed me as well. I assume that there was a good use case for this.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Lonni J Friedman (#2)
Re: Postgresql logfilename and times in GMT - not EST

Lonni J Friedman <netllama@gmail.com> writes:

On Tue, Dec 4, 2012 at 1:59 PM, Bryan Montgomery <monty@english.net> wrote:

I changed postgres.conf to have timezone = 'EST' and restarted postgres.
However the log file is still 5 hours ahead. What gives? Not the end of the
world but a bit annoying.

you need to set log_timezone . This is a new 'feature' in 9.2 that
annoyed me as well. I assume that there was a good use case for this.

"New"? log_timezone has been around since 8.3, and it seems like a good
idea to me --- what if you have N sessions each with its own active
timezone setting? Timestamps in the log would be an unreadable mismash
if there weren't a separate log_timezone setting.

What did change in 9.2 is that initdb sets values for timezone and
log_timezone in postgresql.conf, so it's the initdb environment that
will determine what you get in the absence of any manual action.
Before that it was the postmaster's environment.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Lonni J Friedman
netllama@gmail.com
In reply to: Tom Lane (#3)
Re: Postgresql logfilename and times in GMT - not EST

On Tue, Dec 4, 2012 at 2:42 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Lonni J Friedman <netllama@gmail.com> writes:

On Tue, Dec 4, 2012 at 1:59 PM, Bryan Montgomery <monty@english.net> wrote:

I changed postgres.conf to have timezone = 'EST' and restarted postgres.
However the log file is still 5 hours ahead. What gives? Not the end of the
world but a bit annoying.

you need to set log_timezone . This is a new 'feature' in 9.2 that
annoyed me as well. I assume that there was a good use case for this.

"New"? log_timezone has been around since 8.3, and it seems like a good
idea to me --- what if you have N sessions each with its own active
timezone setting? Timestamps in the log would be an unreadable mismash
if there weren't a separate log_timezone setting.

What did change in 9.2 is that initdb sets values for timezone and
log_timezone in postgresql.conf, so it's the initdb environment that
will determine what you get in the absence of any manual action.
Before that it was the postmaster's environment.

Sorry, I meant new, in that its impact changed in 9.2 such that it
needed to be explicitly set to not get UTC by default, whereas in the
past that wasn't required.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general