Re: Postgres timestamps are out by one hour

Lists: pgsql-admin
From: "Simon Kinsella" <simon(at)bluefiresystems(dot)co(dot)uk>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Postgres timestamps are out by one hour
Date: 2006-10-26 15:17:41
Message-ID: 20061026151745.F0C8C198AC6@smtp03l.fasthosts.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Hello,

I'm experiencing a strange problem on two of my installs (PostgreSQL 8.1.4
on FreeBSD6.1-Release):

From the shell:

root(at)stilton> date
Thu Oct 26 16:03:09 BST 2006

From psql/any sql client:

template1=# select now();
now
------------------------------
2006-10-26 15:03:24.43408+00

The shell / system timestamp is correct local time (London, daylight
saving), but the postgres time is one hour behind.

postgresql.conf shows:
#timezone = unknown # actually, defaults to TZ
# environment setting

This is happening on two machines, but not on a third. All with same version
and config. Not sure where to start - any clues? Sounds like some time zone
or daylight saving thing...?

---
Simon Kinsella


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Simon Kinsella" <simon(at)bluefiresystems(dot)co(dot)uk>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Postgres timestamps are out by one hour
Date: 2006-10-26 15:52:55
Message-ID: 21149.1161877975@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

"Simon Kinsella" <simon(at)bluefiresystems(dot)co(dot)uk> writes:
> The shell / system timestamp is correct local time (London, daylight
> saving), but the postgres time is one hour behind.

What does SHOW TIMEZONE say?

regards, tom lane


From: "Simon Kinsella" <simon(at)bluefiresystems(dot)co(dot)uk>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Postgres timestamps are out by one hour
Date: 2006-10-26 16:07:01
Message-ID: 20061026160705.D621716A928@smtp01l.fasthosts.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

template1=# show timezone;
TimeZone
----------
GMT0

Thanks.

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
Sent: Thursday, October 26, 2006 4:53 PM
To: Simon Kinsella
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Postgres timestamps are out by one hour

"Simon Kinsella" <simon(at)bluefiresystems(dot)co(dot)uk> writes:
> The shell / system timestamp is correct local time (London, daylight
> saving), but the postgres time is one hour behind.

What does SHOW TIMEZONE say?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Simon Kinsella" <simon(at)bluefiresystems(dot)co(dot)uk>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Postgres timestamps are out by one hour
Date: 2006-10-26 16:16:25
Message-ID: 21444.1161879385@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

"Simon Kinsella" <simon(at)bluefiresystems(dot)co(dot)uk> writes:
> template1=# show timezone;
> TimeZone
> ----------
> GMT0

That's a non-daylight-savings zone ... and one would guess that the
postmaster was started with TZ=GMT or some such, else it would not have
picked that as the Postgres zone.

regards, tom lane


From: "Simon Kinsella" <simon(at)bluefiresystems(dot)co(dot)uk>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Postgres timestamps are out by one hour
Date: 2006-10-27 08:36:34
Message-ID: 20061027083646.AE5F4199D19@smtp04l.fasthosts.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Thanks for your help Tom - I've got it sorted now by setting
timezone='GMT0DST' in the conf file.

Simon.

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Thursday, October 26, 2006 5:16 PM
To: Simon Kinsella
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Postgres timestamps are out by one hour

"Simon Kinsella" <simon(at)bluefiresystems(dot)co(dot)uk> writes:
> template1=# show timezone;
> TimeZone
> ----------
> GMT0

That's a non-daylight-savings zone ... and one would guess that the
postmaster was started with TZ=GMT or some such, else it would not have
picked that as the Postgres zone.

regards, tom lane