BUG #1757: timestamp 'epoch' is not absolute

From: "Steve Bennett" <S(dot)Bennett(at)lancaster(dot)ac(dot)uk>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1757: timestamp 'epoch' is not absolute
Date: 2005-07-06 21:31:40
Message-ID: 20050706213140.B84EBF0B06@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1757
Logged by: Steve Bennett
Email address: S(dot)Bennett(at)lancaster(dot)ac(dot)uk
PostgreSQL version: 8.0.3
Operating system: Linux
Description: timestamp 'epoch' is not absolute
Details:

I'm seeing a rather annoying problem converting timestamps between unix and
PostgreSQL. It appears that the timestamp 'epoch' is being interpreted as
relative to the local timezone, rather than being an absolute time.

e.g. I'm in the UK, and at the moment we're in summer time, which is UTC+1.
If I do:
select date_part('epoch', timestamp 'epoch');
I get:
date_part
-----------
-3600

Whereas if I do:
select date_part('epoch', timestamp 'epoch' AT TIME ZONE 'UTC');
I get:
date_part
-----------
0
Am I misunderstanding what's going on here?
Is there any circumstance where 'epoch' should vary according to the
timezone that you happen to be in?

Thanks in advance

Steve.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Denis Vlasenko 2005-07-07 05:21:38 Re: BUG #1756: PQexec eats huge amounts of memory
Previous Message Tom Lane 2005-07-06 14:49:31 Re: Creating trigger function with argument(s) gets backend crash.