Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDVrZ-0006kM-Fe for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Sep 2019 15:39:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iDVrY-00058c-Do for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Sep 2019 15:39:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDVrY-00058V-6I for pgsql-bugs@lists.postgresql.org; Thu, 26 Sep 2019 15:39:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDVrW-0003JK-2c for pgsql-bugs@lists.postgresql.org; Thu, 26 Sep 2019 15:39:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x8QFdHpO013931; Thu, 26 Sep 2019 11:39:18 -0400 From: Tom Lane To: jeff.sturm@helloworld.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16027: Invalid output of to_timestamp In-reply-to: <16027-8b799f2d11947553@postgresql.org> References: <16027-8b799f2d11947553@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 26 Sep 2019 15:20:56 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13929.1569512357.1@sss.pgh.pa.us> Date: Thu, 26 Sep 2019 11:39:17 -0400 Message-ID: <13930.1569512357@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > With a date in year 1904 or earlier, the to_timestamp function outputs > unexpected characters: > template1=# select to_timestamp('19041231','YYYYMMDD'); > to_timestamp > ------------------------------ > 1904-12-31 00:00:00-05:32:11 > Expected is "1904-12-31 00:00:00-06" There's nothing particularly unexpected about that. I surmise that you're using the America/Detroit zone, because nothing else matches that UTC offset, and what the IANA timezone database has for Detroit is # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Detroit -5:32:11 - LMT 1905 -6:00 - CST 1915 May 15 2:00 with some commentary explaining why they think Detroit adopted standard time in 1905 rather than some other year. Before standardized time, most places observed local solar time, so tzdb provides an estimate of what the UTC offset would have been for that in Detroit. If this discombobulates you, you can edit your local copy of the tzdb files; but it's not wrong from our standpoint. regards, tom lane