Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCUBd-0000Nr-NO for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 15:54:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bCUBd-0004rp-A9 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 15:54:01 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bCUAH-0003Dt-3H for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 15:52:37 +0000 Received: from nm1-vm10.bullet.mail.sg3.yahoo.com ([106.10.148.97]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bCUAC-00019r-VR for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 15:52:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s2048; t=1465833145; bh=3mM6XO7co18syXm6ug3ThMzZG+JMVwuy+GchR9kLM+k=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=Uk4Od5As0Upl00kamsIKBIfbWicVGXxb7wLAidCrKqFBok+ZDrAV/eECDPsi4i8160nMvwGBtvDs+XwioKrHzFsOxI8eqwdF++Ibh4HHF3RmUKL9ul3k/kkzPCWG1+EHBw48VRjVgKKd8NtZ3eafib2WxGSKvJ38z/v4UmUi60hWGokSlZQi3MzUzqVaqcBi34g4RYWzx3sq9KwquCex2vQO3oXuIFrQY5+r4s5VgupceUwC5fG3ziRpmUkS8vwOavWkWLF0qBeFz3skSQlsqmfYJ8y96j1kQ8SVOSZ/JfuSDHPBD6ibzbV7YURXQidWtiqZRSz3HhJhQQ4qcgJRJg== Received: from [106.10.166.123] by nm1.bullet.mail.sg3.yahoo.com with NNFMP; 13 Jun 2016 15:52:25 -0000 Received: from [106.10.151.253] by tm12.bullet.mail.sg3.yahoo.com with NNFMP; 13 Jun 2016 15:52:25 -0000 Received: from [127.0.0.1] by omp1002.mail.sg3.yahoo.com with NNFMP; 13 Jun 2016 15:52:25 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 956872.19700.bm@omp1002.mail.sg3.yahoo.com X-YMail-OSG: gAMxWqgVM1kykyGJ12liBgC3.c2.7qH1OXWjQen0_7PsFODK8GIGOUUsutpHNB2 TOhtoevBZ_0M6fyfFXz77iC7RaR8geZsWbqqOUrBFYPfpoOb8Ez_7WByZzHJaQ3i_.CrX9oSJ2sq nLVkO58Qts1r3gD5gfGZHde5CLMEE9lVfTYjdmmnoATBKCmD37G5iMaFdadezFFmg0zWU66dSXzD zLQgrxcAs4N19G1gM8P0T1LuihTdOb4PfImyavKItvUU9P0KWCa1tKfmD8iyZGfZhCuUtgZxukJc uHpNRb5RGQ9qSydJ6Is9E4ySA.34eiKBCnglwQ8MFKnqRS4neJWtm9wQtmXEvNA_U09ya_ZAXprE PoNRT8unQ5HAAGDWv3WCLA.WeerOvLsnOue2sQAh6Ra7TObVr4m5FduzAqn0AEkHhmkODmFLvF7P mBcqruEkPMnwagTs.NipbA.6O2.lcG6bl2c9wYDZfGhkuE3tV.Mtp0iGqr9h3O4mq6OA5D5XmU1x PSuKOk0Tjcg-- Received: from jws10913.mail.sg3.yahoo.com by sendmailws101.mail.sg3.yahoo.com; Mon, 13 Jun 2016 15:52:25 +0000; 1465833145.508 Date: Mon, 13 Jun 2016 15:52:25 +0000 (UTC) From: amul sul Reply-To: amul sul To: PostgreSQL-development Message-ID: <1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com> Subject: Bug in to_timestamp(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable References: <1873520224.1784572.1465833145330.JavaMail.yahoo.ref@mail.yahoo.com> Content-Length: 827 X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hi, It's look like bug in to_timestamp() function when format string has more w= hitespaces compare to input string, see below:=20 Ex.1: Two white spaces before HH24 whereas one before input time string postgres=3D# SELECT TO_TIMESTAMP('2016-06-13 15:43:36', 'YYYY/MM/DD HH24:M= I:SS'); to_timestamp=20 ------------------------ 2016-06-13 05:43:36-07 <=E2=80=94 incorrect time=20=20=20=20=20=20=20= =20=20=20=20=20=20 (1 row) Ex.2: One whitespace before YYYY format string postgres=3D# SELECT TO_TIMESTAMP('2016/06/13 15:43:36', ' YYYY/MM/DD HH24:M= I:SS'); to_timestamp=20 ------------------------------ 0016-06-13 15:43:36-07:52:58 <=E2=80=94 incorrect year (1 row) If there are one or more consecutive whitespace in the format, we should sk= ip those as long as we could get an actual field. Thoughts? Thanks & Regards, Amul Sul --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers