| From: | Laszlo Nagy <gandalf(at)shopzeus(dot)com> |
|---|---|
| To: | Steve Crawford <scrawford(at)pinpointresearch(dot)com>, pgsql-performance(at)postgresql(dot)org |
| Subject: | Re: [ADMIN] Messed up time zones |
| Date: | 2012-08-03 17:21:08 |
| Message-ID: | 501C0884.1040106@shopzeus.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin pgsql-performance |
> All the above are the exact same point in time merely stated as
> relevant to each location. Note that given a timestamp with time zone
> and a zone, PostgreSQL returns a timestamp without time zone (you know
> the zone since you specified it).
Yes, I know the zone. But I don't know the offset from UTC.
Example:
template1=> set timezone to 'UTC';
SET
template1=> select ('2011-10-30 01:00:00'::timestamptz) at time zone
'Europe/Budapest';
timezone
---------------------
2011-10-30 02:00:00 -- Is it winter or summer time?
(1 row)
template1=> select ('2011-10-30 00:00:00'::timestamptz) at time zone
'Europe/Budapest';
timezone
---------------------
2011-10-30 02:00:00 -- Is it winter or summer time? What is the
offset from UTC here? Can you tell me when it was in UTC?
(1 row)
template1=>
What is more:
template1=> select (('2011-10-30 00:00:00'::timestamptz) at time zone
'Europe/Budapest') is distinct from (('2011-10-30
01:00:00'::timestamptz) at time zone 'Europe/Budapest');
?column?
----------
f
(1 row)
template1=>
Yeah, we know what time zone it is in, but we don't know when it was,
thanks a lot. :-( It would be unambiguous to store the UTC offset along
with the value. But it is not how it was implemented.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Laszlo Nagy | 2012-08-03 17:25:48 | Re: Messed up time zones |
| Previous Message | Tom Lane | 2012-08-03 16:38:11 | Re: Messed up time zones |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Laszlo Nagy | 2012-08-03 17:25:48 | Re: Messed up time zones |
| Previous Message | Tom Lane | 2012-08-03 16:38:11 | Re: Messed up time zones |