Re: Inconsistent behavior with TIMESTAMP WITHOUT and epoch - Mailing list pgsql-bugs

From Josh Berkus
Subject Re: Inconsistent behavior with TIMESTAMP WITHOUT and epoch
Date
Msg-id 200501271117.41205.josh@agliodbs.com
Whole thread Raw
In response to Re: Inconsistent behavior with TIMESTAMP WITHOUT and epoch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom,

> How so?  If you think that the timestamp-without-zone is relative to GMT
> rather than your local zone, you say something like
>     extract(epoch from (timestampvar AT TIME ZONE 'GMT'))

Ah, that didn't seem to work before.  I must have done the parens wrong.

> Quite honestly, you should be using timestamp WITH time zone for such an
> application anyway.  The timestamp without zone datatype is very
> strongly biased towards the assumption that the value is in your local
> timezone, and if you've actually got multiple possible settings of
> TimeZone then it's simply a great way to shoot yourself in the foot.

Well, I was thinking about this on the way to my office this AM, and realized
that there's a fundamental gulf between timestamp-as-real-moment-in-time (the
SQL timestamp and postgres timestamp) and timestamp-as-mark-on-the-calendar
(what I'm dealing with), and that my trouble stems from trying to coerce the
first into the second.

Maybe it's time to hack a datatype ...

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-bugs by date:

Previous
From: Tamas Vincze
Date:
Subject: Re: 8.0.0 make check fails on Solaris 9 (sparc)
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] My postmaster just crashed !