Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id EF1A01465A38 for ; Wed, 30 May 2012 18:12:20 -0300 (ADT) Received: from mail-ee0-f46.google.com ([74.125.83.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SZqBn-0005z8-Ow for pgsql-bugs@postgresql.org; Wed, 30 May 2012 21:12:20 +0000 Received: by eeit10 with SMTP id t10so88864eei.19 for ; Wed, 30 May 2012 14:12:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; bh=P3XQb6eb0nTBF6ab9l9re8gLlzfZbv78KhTmdZwY5Zs=; b=XOWfuDUiEjlu0rqCFii8d7bemlbNhsIPHQ+0YlFcjAXnzdWvV1DRVHeZrkan5AEfcM 7cq9vmR/yXvI1BxVM+yEXK+sUeHpfeDmHkcWGVrE9QLR2ImXNqZgkFlcGuSScsOhJTh4 S9Cvwi/7iSdUbe10NsWuPFxPiXER/F96b7DuUVOHfzIJlbeqdshU//eBVSRHBYhtZLAG tPTV8jbo6rWox+VHmF/3J/vOXL0qeQJ+7c3uOY3zeTdW2RquBf2LOuFlvTHEuzjP5spW dyGAVv6unTmfNvYA5fvGLjHiBFsZ+fT9Lm8IdJEXhf9HSxi6tblWUGdmzGoA8IwoMfrF PhnA== Received: by 10.14.97.135 with SMTP id t7mr6743080eef.177.1338412326402; Wed, 30 May 2012 14:12:06 -0700 (PDT) Received: from [192.168.1.72] (ip-88-207-241-160.dyn.luxdsl.pt.lu. [88.207.241.160]) by mx.google.com with ESMTPS id v46sm2983645eef.11.2012.05.30.14.12.04 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 May 2012 14:12:05 -0700 (PDT) Message-ID: <4FC68D23.9050402@googlemail.com> Date: Wed, 30 May 2012 23:12:03 +0200 From: Patric Bechtel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: pg_dump/pg_restore with time zone displacement out of range X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201205/228 X-Sequence-Number: 33199 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I have the following strange effect, maybe someone has an idea on wether this is 'normal' or a bug: My platform: Ubuntu 12.04, PostgreSQL 9.2beta1, tried it with 9.1 with same result. postgresql.conf is stock, except for timezone, which is set to Asia/Manila. $ createdb -U postgres tztest $ psql tztest postgres tztest=# create table foo (bar int, baz timestamptz); CREATE TABLE tztest=# insert into foo values (1,'2012-05-01T14:00:00'); INSERT 0 1 tztest=# insert into foo values (2,'2012-05-01T14:00:00 bc'); INSERT 0 1 tztest=# select * from foo; bar | baz - -----+------------------------------ 1 | 2012-05-01 14:00:00+08 2 | 2012-05-01 14:00:00-15:56 BC Now that's strange already. Take a look upon this funny timezone offset. Let's backup this now. $ pg_dump -Fp -U postgres -x -O -a -f "tztest@pht.sql" tztest $ grep -e '^[12]' tztest@pht.sql 1 2012-05-01 14:00:00+08 2 2012-05-01 14:00:00-15:56 BC Now that's expected, it's the same as the output before. Let's restore it. $ psql tztest postgres tztest=# delete from foo; DELETE tztest=# \i tztest@pht.sql [...] psql:tztest@pht.sql:20: ERROR: time zone displacement out of range: "2012-05-01 14:00:00-15:56 BC" KONTEXT: COPY foo, line 2, column baz: "2012-05-01 14:00:00-15:56 BC" tztest=# It can't import because -15:56 is out of range for a timezone offset. But it's in the backup, so it should restore it, though, right? Doing this with any other format, using pg_restore, gives the same error. The only workaround I found was (without sacrificing functionality of date queries, that is) was to manually set the time zone to GMT+8 *prior* to running pg_dump. My question upon you is now: Is it my platform, which causes this, or is the constraint within the restore which is bad, or, which is my best bet, should pg_dump leave it's fingers off the time zone calculation and backup the data as if time zone 'UTC' was given within postgresql.conf? - -- cu, Patric -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: GnuPT 2.5.2 iEYEARECAAYFAk/GjSMACgkQfGgGu8y7ypD6WwCgj0EPBp7RpQENNtZA4vvefooP 7DcAoNkIl3EkUnk1rYFigoMta4fm/6Q0 =TMAu -----END PGP SIGNATURE-----