BUG #1757: timestamp 'epoch' is not absolute - Mailing list pgsql-bugs

From Steve Bennett
Subject BUG #1757: timestamp 'epoch' is not absolute
Date
Msg-id 20050706213140.B84EBF0B06@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #1757: timestamp 'epoch' is not absolute  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1757
Logged by:          Steve Bennett
Email address:      S.Bennett@lancaster.ac.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.

pgsql-bugs by date:

Previous
From: "Boris Sukholitko"
Date:
Subject: BUG #1759: domain check constraint ignored in prepared statement
Next
From: Michael Fuhr
Date:
Subject: Re: Sun inline assembler ...