Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id D3DE61EC320E for ; Sat, 21 Apr 2012 04:12:04 -0300 (ADT) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SLUUF-00062c-0g for pgsql-bugs@postgresql.org; Sat, 21 Apr 2012 07:12:04 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SLUU2-0004SQ-He for pgsql-bugs@postgresql.org; Sat, 21 Apr 2012 07:11:50 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1SLUU2-0004nB-1c for pgsql-bugs@postgresql.org; Sat, 21 Apr 2012 07:11:50 +0000 Date: Sat, 21 Apr 2012 07:11:50 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6605: wrong type cast from timestamp to timestamptz To: pgsql-bugs@postgresql.org From: eshkinkot@gmail.com X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201204/122 X-Sequence-Number: 32873 The following bug has been logged on the website: Bug reference: 6605 Logged by: Sergey Burladyan Email address: eshkinkot@gmail.com PostgreSQL version: 9.1.3 Operating system: Debian testing Description: = Postgres from Debian package: PostgreSQL 9.1.3 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.6.3-1) 4.6.3, 64-bit Good: set timezone to 'Europe/Moscow'; select '2011-03-27 23:00:00'::timestamptz; SET =D0=92=D1=80=D0=B5=D0=BC=D1=8F: 0,092 =D0=BC=D1=81 timestamptz = ------------------------ 2011-03-27 23:00:00+04 Bad: set timezone to 'W-SU'; select '2011-03-27 23:00:00'::timestamptz; SET =D0=92=D1=80=D0=B5=D0=BC=D1=8F: 0,106 =D0=BC=D1=81 timestamptz = ------------------------ 2011-03-28 02:59:54+04 Good again: set timezone to 'W-SU'; select '2011-03-27 23:00:01'::timestamptz; SET =D0=92=D1=80=D0=B5=D0=BC=D1=8F: 0,135 =D0=BC=D1=81 timestamptz = ------------------------ 2011-03-27 23:00:01+04 For information, 2011-03-27 the last day when Daylight Saving Time was used. After it Daylight Saving Time is canceled in Russia: W-SU is symlink: $ ls -la /usr/share/zoneinfo/Europe/Moscow = lrwxrwxrwx 1 root root 7 =D0=9C=D0=B0=D1=80 6 22:39 /usr/share/zoneinfo/Eu= rope/Moscow -> ../W-SU $ zdump -v W-SU | tail W-SU Sat Oct 24 22:59:59 2009 UTC =3D Sun Oct 25 02:59:59 2009 MSD isdst= =3D1 gmtoff=3D14400 W-SU Sat Oct 24 23:00:00 2009 UTC =3D Sun Oct 25 02:00:00 2009 MSK isdst= =3D0 gmtoff=3D10800 W-SU Sat Mar 27 22:59:59 2010 UTC =3D Sun Mar 28 01:59:59 2010 MSK isdst= =3D0 gmtoff=3D10800 W-SU Sat Mar 27 23:00:00 2010 UTC =3D Sun Mar 28 03:00:00 2010 MSD isdst= =3D1 gmtoff=3D14400 W-SU Sat Oct 30 22:59:59 2010 UTC =3D Sun Oct 31 02:59:59 2010 MSD isdst= =3D1 gmtoff=3D14400 W-SU Sat Oct 30 23:00:00 2010 UTC =3D Sun Oct 31 02:00:00 2010 MSK isdst= =3D0 gmtoff=3D10800 W-SU Sat Mar 26 22:59:59 2011 UTC =3D Sun Mar 27 01:59:59 2011 MSK isdst= =3D0 gmtoff=3D10800 W-SU Sat Mar 26 23:00:00 2011 UTC =3D Sun Mar 27 03:00:00 2011 MSK isdst= =3D0 gmtoff=3D14400 W-SU 9223372036854689407 =3D NULL W-SU 9223372036854775807 =3D NULL I also see this problem in my other server with 9.0: select '2011-03-27 23:00:00'::timestamptz; timestamptz = ------------------------ 2068-04-02 03:00:00+04 (1 row)