Skip site navigation (1) Skip section navigation (2)

Re: BUG #1757: timestamp 'epoch' is not absolute

From: "Bennett, Steve" <s(dot)bennett(at)lancaster(dot)ac(dot)uk>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #1757: timestamp 'epoch' is not absolute
Date: 2005-07-07 20:30:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
> > It appears that the timestamp 'epoch' is being interpreted as
> > relative to the local timezone, rather than being an absolute time.
> This is correct for timestamp ... you want timestamp with time zone.

Sorry, but that's dumb (IMHO). The unix epoch is not relative to the
local timezone.

I'm now using a function to convert from unix times to timestamps, since
the alternative is ugly and verbose even by SQL standards...

  create function epoch(integer)
    returns timestamp with time zone
    as 'select timestamp with time zone \'epoch\'
        + interval \'1 second\' * $1;'
    language sql immutable;

Is there a better way?



pgsql-bugs by date

Next:From: Tom LaneDate: 2005-07-07 20:52:19
Subject: Re: BUG #1757: timestamp 'epoch' is not absolute
Previous:From: Jim C. NasbyDate: 2005-07-07 20:29:07
Subject: FreeBSD 4.x pthreads issues

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group