Odd timezone backend output

From: Andrew Chernow <ac(at)esilo(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Odd timezone backend output
Date: 2008-05-01 13:53:41
Message-ID: 4819CB65.80302@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I am confused about the below results. The backend is in EDT but it is
converting timestamps into EST ... excluding NOW(). Regardless of the
timezone provided, the backend is dishing out EST.

[root(at)dev43 ~]# uname -a
2.6.9-67.0.4.EL #1 Sun Feb 3 06:53:29 EST 2008 i686 athlon i386 GNU/Linux

[root(at)dev43 ~]# date
Thu May 1 09:54:17 EDT 2008

postgres=# select version();
PostgreSQL 8.3devel on i686-pc-linux-gnu, compiled by GCC gcc (GCC)
3.4.6 20060404 (Red Hat 3.4.6-8)

postgres=# set datestyle='Postgres, MDY';
postgres=# select now();
now
-------------------------------------
Thu May 01 09:28:53.164084 2008 EDT

postgres=# select '1997-01-29 12:31:42.92214 EDT'::timestamptz;
timestamptz
------------------------------------
Wed Jan 29 11:31:42.92214 1997 EST

postgres=# select '1997-01-29 12:31:42.92214 PST'::timestamptz;
timestamptz
------------------------------------
Wed Jan 29 15:31:42.92214 1997 EST

Is this expected behavior? I am not sure if I am missing something or
my results are wrong. Is there a setting that needs tweaking?

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-05-01 14:11:37 Re: Odd timezone backend output
Previous Message Andrew Sullivan 2008-05-01 13:13:27 Re: Protection from SQL injection