Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfn8l-0003k3-4q for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Jun 2020 16:18:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jfn8j-0004OR-OD for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Jun 2020 16:18:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfn8j-0004OK-Hq for pgsql-bugs@lists.postgresql.org; Mon, 01 Jun 2020 16:18:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfn8h-0007ij-58 for pgsql-bugs@lists.postgresql.org; Mon, 01 Jun 2020 16:18:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 051GIBeg385759; Mon, 1 Jun 2020 12:18:12 -0400 From: Tom Lane To: Alexander Korotkov cc: jesvh.cht@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16472: Bug in to_timestamp ? In-reply-to: References: <16472-ab9037fa90ff70f3@postgresql.org> Comments: In-reply-to Alexander Korotkov message dated "Mon, 01 Jun 2020 15:02:23 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <385757.1591028291.1@sss.pgh.pa.us> Date: Mon, 01 Jun 2020 12:18:11 -0400 Message-ID: <385758.1591028291@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alexander Korotkov writes: > On Mon, Jun 1, 2020 at 1:38 PM PG Bug reporting form > wrote: >> I execute a update SQL as below : >> update Table1 set date1=to_timestamp('19790701000000', 'YYYYMMDDHH24MISS') >> where ..... >> date1 is a timestamp type column, the result in DB is 1979-07-01 01:00:00 >> where come from that '01' hour ? > It's likely related to clock shift in your timezone. July 1 would be an odd time for a seasonal DST shift ... but quickly thumbing through the tzdata files, I see one for Asia/Taipei on that date in 1979. So I guess that the OP is using that zone, and the answer to the question is "midnight of that date did not exist in Taiwan; their clocks shifted forward from 23:59:59 to 01:00:00". regards, tom lane