Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCUUs-0001R1-B6 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 16:13:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bCUUr-0002TK-5k for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 16:13:53 +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 1bCUTV-0000WH-4C for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 16:12:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bCUTR-0001b7-OD for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 16:12:28 +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 u5DGCOxD020933; Mon, 13 Jun 2016 12:12:24 -0400 From: Tom Lane To: amul sul cc: PostgreSQL-development Subject: Re: Bug in to_timestamp(). In-reply-to: <1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com> References: <1873520224.1784572.1465833145330.JavaMail.yahoo.ref@mail.yahoo.com> <1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com> Comments: In-reply-to amul sul message dated "Mon, 13 Jun 2016 15:52:25 -0000" Date: Mon, 13 Jun 2016 12:12:24 -0400 Message-ID: <20932.1465834344@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) 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 amul sul writes: > It's look like bug in to_timestamp() function when format string has more whitespaces compare to input string, see below: No, I think this is a case of "input doesn't match the format string". As a rule of thumb, using to_timestamp() for input that could be parsed just fine by the standard timestamp input function is not a particularly good idea. to_timestamp() is meant to deal with input that is in a well-defined format that happens to not be parsable by timestamp_in. This example doesn't meet either of those preconditions. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers