Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFzKa-00063B-3V for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Jun 2016 07:45:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bFzKZ-000697-8z for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Jun 2016 07:45:43 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bFzJA-0004Q2-N1 for pgsql-hackers@postgresql.org; Thu, 23 Jun 2016 07:44:18 +0000 Received: from nm5-vm9.bullet.mail.sg3.yahoo.com ([106.10.148.152]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bFzJ3-0006VU-AG for pgsql-hackers@postgresql.org; Thu, 23 Jun 2016 07:44:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s2048; t=1466667844; bh=HuZt8m1Ls7059/KCShGxnmpo+3a3zGAPnIyM3pmNRA4=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=bkwAbv8UWny9oRxTgUFTm2u+SqctshNTgluymx3faYhExo9nEqk9E9xg57UEeO5JANdATs4OM9s9xfWxdJLSiHeaorgP3oeYBeWOlm8LrA+QdvdeD4GmnEX0ecD2cWAm4eZIry3nql899YYeMbOKIkzHXbOOGvXiFrec6O0uZup3AccBOvtFS+D+YTnPn88pI31+FpQtMQOiyDXgDFlLzxgLohmKbPOFzzctmC72ic9blithY7uf8MUgle50hSKgWMo0HmLvJiRtlr9/1ofpETmBTwA2L7xyp739aV5KAaTLb9Sol+QdW2kwJv9mQ6QzKfAmENC7auvegrs+zoPzPg== Received: from [106.10.166.126] by nm5.bullet.mail.sg3.yahoo.com with NNFMP; 23 Jun 2016 07:44:04 -0000 Received: from [106.10.151.250] by tm15.bullet.mail.sg3.yahoo.com with NNFMP; 23 Jun 2016 07:44:04 -0000 Received: from [127.0.0.1] by omp1021.mail.sg3.yahoo.com with NNFMP; 23 Jun 2016 07:44:04 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 939046.85246.bm@omp1021.mail.sg3.yahoo.com X-YMail-OSG: _Z9Acd4VM1mltyjBmEJyDIAP60ymgAK.9q5L7lBaIOrfa5J7cEEpcsr8HsDMpo7 uENCHA7EslZxIAEKIBv0xvtVXxCtqXSVodWLeDJICovoRxorTLclhKkCuzkevFF52E6GrpHD_hXk GVOgNd8ifWLlZiByzST076HTeM.oF66FGODBaBjlPUiqdEzzY.irEFkJfxnLEjCZqloHqGG8OnJ9 XosBlrkEWLCXRpSci3mb8gsLiuyTGkQWQl7jqm0j1U2EIjZAlpJyHMO864HLXjtLSAOYV6E0e00M Zl69D1pA0q2XhIIRTffSncdE5qnQOy5NSb7ykpu5eljylXhTKhDMDA.Xi4a09eYWxnZBygdYiGwl TauxP5yo.D4_nvaoS_mFlg1axDc5NRK7FOADuAAEfe3wUaiAH532KLH4.fCyIXHIPWVz0vXjYVnU 5XO9SnXwe.SuOgB_jqZjM22gFazjL_FUCcjki0G0jXoGUJpNQqnOufE83Dc7.XT9oeg3YYIQAb7r VO1tKnbp.rbKygOmp_keCDHbw_OZOx6Hrk9U0FZ34_WHK2gUxW2wFPbo- Received: from jws10947.mail.sg3.yahoo.com by sendmailws101.mail.sg3.yahoo.com; Thu, 23 Jun 2016 07:42:24 +0000; 1466667744.702 Date: Thu, 23 Jun 2016 07:41:26 +0000 (UTC) From: amul sul Reply-To: amul sul To: Alex Ignatov , PostgreSQL-development Message-ID: <884791796.213185.1466667686999.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: References: <1873520224.1784572.1465833145330.JavaMail.yahoo.ref@mail.yahoo.com> <1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com> Subject: Re: Bug in to_timestamp(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 777 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 On Monday, 20 June 2016 8:53 PM, Alex Ignatov wrote: >>On 13.06.2016 18:52, amul sul wrote: >And it wont stop on some simple whitespace. By using to_timestamp you >can get any output results by providing illegal input parameters values: >postgres=# SELECT TO_TIMESTAMP('2016-06-13 99:99:99', 'YYYYMMDD >HH24:MI:SS'); > to_timestamp >------------------------ > 2016-01-06 14:40:39+03 > > (1 row) We do consume extra space from input string, but not if it is in format string, see below: postgres=# SELECT TO_TIMESTAMP('2016-06-13 15:43:36', 'YYYY/MM/DD HH24:MI:SS'); to_timestamp ------------------------ 2016-06-13 15:43:36-07 (1 row) We should have same treatment for format string too. Thoughts? Comments? Regards, Amul Sul -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers