Re: [ADMIN] Messed up time zones - Mailing list pgsql-performance

From Laszlo Nagy
Subject Re: [ADMIN] Messed up time zones
Date
Msg-id 501C0884.1040106@shopzeus.com
Whole thread Raw
Responses Re: [ADMIN] Messed up time zones
List 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.

pgsql-performance by date:

Previous
From: roberthanco@o2.pl
Date:
Subject: Postgresql - performance of using array in big database
Next
From: Steve Crawford
Date:
Subject: Re: [ADMIN] Messed up time zones