Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGTMv-0003Nh-Gd for pgsql-hackers@arkaria.postgresql.org; Sun, 19 Nov 2017 17:26:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGTMt-00028k-Oh for pgsql-hackers@arkaria.postgresql.org; Sun, 19 Nov 2017 17:26:55 +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 1eGTMt-00028Z-J5 for pgsql-hackers@lists.postgresql.org; Sun, 19 Nov 2017 17:26:55 +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.89) (envelope-from ) id 1eGTMp-0007ZW-Lp for pgsql-hackers@postgresql.org; Sun, 19 Nov 2017 17:26:54 +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 vAJHQd7I009092; Sun, 19 Nov 2017 12:26:39 -0500 From: Tom Lane To: Arthur Zakirov cc: amul sul , Pavel Stehule , Robert Haas , "David G. Johnston" , Alex Ignatov , Bruce Momjian , amul sul , PostgreSQL-development Subject: Re: [HACKERS] Bug in to_timestamp(). In-reply-to: <20171119144734.GA12415@arthur.localdomain> References: <32684.1466704957@sss.pgh.pa.us> <734e50cd-c563-4afd-d1c8-80f244b3265e@postgrespro.ru> <29142.1475097531@sss.pgh.pa.us> <8744.1478284597@sss.pgh.pa.us> <29637.1511045306@sss.pgh.pa.us> <20171119144734.GA12415@arthur.localdomain> Comments: In-reply-to Arthur Zakirov message dated "Sun, 19 Nov 2017 17:47:35 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9090.1511112399.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 19 Nov 2017 12:26:39 -0500 Message-ID: <9091.1511112399@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Arthur Zakirov writes: > On Sat, Nov 18, 2017 at 05:48:26PM -0500, Tom Lane wrote: >> ... I see from your regression test additions that >> you want to make some of these throw an error, and I think that any suc= h >> proposal is dead in the water. Nobody is going to consider it an >> improvement if it both breaks working PG apps and disagrees with Oracle= . > Only queries with FX field throw an error. Ah, I see --- I'd missed that FX was relevant to this. Yeah, maybe it'd be okay to tighten up in that case, since that's making it act more like Oracle, which seems to be generally agreed to be a good thing. I don't much like the error message that you've got: +SELECT to_timestamp('97/Feb/16', 'FXYY:Mon:DD'); +ERROR: unexpected character "/", expected ":" +DETAIL: The given value did not match any of the allowed values for this= field. The DETAIL message seems to have been copied-and-pasted into a context where it's not terribly accurate. I'd consider replacing it with something along the lines of "HINT: In FX mode, punctuation in the input string must exactly match the format string." This way the report will contain a pretty clear statement of the new rule that was broken. (BTW, it's a hint not a detail because it might be guessing wrong as to what the real problem is.) regards, tom lane