Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ba1xp-0006X7-HM for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Aug 2016 14:37:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ba1xo-0004Fz-Hq for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Aug 2016 14:37:04 +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 1ba1wP-0000ht-SU for pgsql-hackers@postgresql.org; Wed, 17 Aug 2016 14:35:38 +0000 Received: from nm19.bullet.mail.sg3.yahoo.com ([106.10.148.70]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ba1wM-0004tZ-0g for pgsql-hackers@postgresql.org; Wed, 17 Aug 2016 14:35:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s2048; t=1471444529; bh=E4vTmiMLjKpmNq40hKlCYf8R8dSpZoZrOxgW0VuOmNk=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=azsZtmdH95M6syHlLrAP7iaQzGsYvK9/csre8ntgxe0xBVF1c99JkJXk99wHBZLzywih2eViorN+m0RUBn8VoXdqrrly/G333tGsLpX75JxWQxywQW2IF6SV0CfiqxEeyhhzdH/b5hjOabpy/aGJTDPdjaqH2SB1k6gviCldyCZNT0tL52Sd9CLnVGOThLWqyJMVlMGHPq7TppIqUE2Qt6r59smtT/yKEBInPPgYJ2b+e4JyTrZ5KfPLDqEeSc3gr7C3BtOM89YzLyjSrkyJa5jmpM4bG4NPE9Dms5u+bOdMiPAHkbXbhUflBpExK+m9rkZ4nEL+Be/77JnUXbzz/Q== Received: from [106.10.166.61] by nm19.bullet.mail.sg3.yahoo.com with NNFMP; 17 Aug 2016 14:35:29 -0000 Received: from [106.10.150.26] by tm18.bullet.mail.sg3.yahoo.com with NNFMP; 17 Aug 2016 14:35:29 -0000 Received: from [127.0.0.1] by omp1027.mail.sg3.yahoo.com with NNFMP; 17 Aug 2016 14:35:29 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 446329.83909.bm@omp1027.mail.sg3.yahoo.com X-YMail-OSG: hpCnmZsVM1mlnwX8mLpmY9z1mb4oAZ2CkxdOsNpVoQ5i1onLQg_fI3ovHQGzV13 8VypguHYv_Pc1ZvjYYk74USt87rm_wtMN0XFjMhbBwfc92mpxsXOhOZ1zq2iseM1hJ_m2BFOjlAd su9HnYrKLuQ6kubPoE9QmTspY0uUJdBwKltifHtnFkl01bLW8S.jOqbzd410P_A4f2yt6Qwj5f6h mA4wmsREPUyvc.AakCq06zYSooAFkM8jAjkyH8Ye4aFM6cFFrND7J_OheSOLECJct5X8QzQ2cHPf eM4ndHYvJfg5VpN_S14_S.j0BcGTqkt31FrEngu4LXinMJvP5Qt9M31m8GEX4GYdMVTYyKqavZyg mrmoJw0mM8GkRyDviddjYoQjdD081Gg7PCqjwkDYn6frBYoObSlXu5Npnm10pOHDRk81rT9uIf73 pfGltoyP4Wg.txChmM9b24RAn_Hp09Vw6pclEPsULoc2oqlJRcu7fqkdVdxiUbxhNf3pDS2q2Ezh 6F_HKLizTbu36wNGWI8q_6pauglMreGI8Ec5npLPnTG_C2appOOXTwA-- Received: from jws10982.mail.sg3.yahoo.com by sendmailws119.mail.sg3.yahoo.com; Wed, 17 Aug 2016 14:35:29 +0000; 1471444529.083 Date: Wed, 17 Aug 2016 14:35:28 +0000 (UTC) From: amul sul Reply-To: amul sul To: Artur Zakirov , Robert Haas Cc: Pavel Stehule , Tom Lane , "David G. Johnston" , Alex Ignatov , Bruce Momjian , PostgreSQL-development Message-ID: <2095510729.14135736.1471444528728.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <60cc3122-0950-e455-21fe-de89882e285d@postgrespro.ru> References: <1873520224.1784572.1465833145330.JavaMail.yahoo.ref@mail.yahoo.com> <884791796.213185.1466667686999.JavaMail.yahoo@mail.yahoo.com> <20160623133001.GF21246@momjian.us> <1877e60a-a970-18b5-453c-e342f96150e6@postgrespro.ru> <31915.1466703655@sss.pgh.pa.us> <32684.1466704957@sss.pgh.pa.us> <734e50cd-c563-4afd-d1c8-80f244b3265e@postgrespro.ru> <1285870380.13225431.1471272994354.JavaMail.yahoo@mail.yahoo.com> <60cc3122-0950-e455-21fe-de89882e285d@postgrespro.ru> Subject: Re: Bug in to_timestamp(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Length: 1522 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 Wednesday, August 17, 2016 5:15 PM, Artur Zakirov wrote: >I attached new patch "0001-to-timestamp-format-checking-v2.patch". It=20 >fixes behaviour for Amul's scenarious: > Great. > >> Following are few scenarios where we break existing behaviour: >> >> SELECT TO_TIMESTAMP('2015-12-31 13:43:36', 'YYYY MM DD HH24 MI SS'); >> SELECT TO_TIMESTAMP('2011$03!18 23_38_15', 'YYYY-MM-DD HH24:MI:SS'); >> SELECT TO_TIMESTAMP('2011*03*18 23^38&15', 'YYYY-MM-DD HH24:MI:SS'); >> SELECT TO_TIMESTAMP('2011*03!18 #%23^38$15', 'YYYY-MM-DD$$$HH24:MI:SS'); >> >> But current patch behaviour is not that much bad either at least we have= errors, but I am not sure about community acceptance. >> >> I would like to divert communities' attention on following case: >> SELECT TO_TIMESTAMP('2013--10-01', 'YYYY-MM-DD'); > > >For queries above the patch gives an output without any error. > > >> Another is, shouldn=E2=80=99t we have error in following cases? >> SELECT TO_TIMESTAMP('2016-06-13 99:99:99', 'YYYY-MM-DD HH24:MI:SS'); >> SELECT TO_TIMESTAMP('2016-02-30 15:43:36', 'YYYY-MM-DD HH24:MI:SS'); > > >I attached second patch "0002-to-timestamp-validation-v2.patch". With it=20 >PostgreSQL perform additional checks for date and time. But as I wrote=20 >there is another patch in the thread "to_date_valid()" wich differs from=20 >this patch. > Hmm. I haven't really looked into the code, but with applying both patches = it looks precisely imitate Oracle's behaviour. 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