Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNcev-00017R-Ny for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Jul 2016 09:10:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bNcev-0001Mf-6A for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Jul 2016 09:10:17 +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 1bNcdZ-0008Dd-3z for pgsql-hackers@postgresql.org; Thu, 14 Jul 2016 09:08:53 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNcdV-0005Y3-DB for pgsql-hackers@postgresql.org; Thu, 14 Jul 2016 09:08:51 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id C74CD21C2301; Thu, 14 Jul 2016 12:08:46 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from mail.postgrespro.ru ([127.0.0.1]) by localhost (mail.postgrespro.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a-jcn5--e1ev; Thu, 14 Jul 2016 12:08:45 +0300 (MSK) Received: from [192.168.27.45] (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id 1F3BD21C22F8; Thu, 14 Jul 2016 12:08:45 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1468487325; bh=E5aTlE8P8fZrtkHwTVETlBtfT+pp2ZW4wDqYk9Y4rJU=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=DVb8Z3uJNgFSSYpAVcvP8eM5q2ZG2lUN/Taz/GwhoT/b8bXM7BP6x/RZN9YwvBODs BNz6MXpbpXDVZLdlEelvWGTXK3KB6qRBvW+/hrESYiKvaxEY09QVpGwej3uQtw8CBR fVyBxPFT4uZ6P23VsIBu5KUmjDPdrRgK7QxlLBXA= Subject: Re: Bug in to_timestamp(). To: Tom Lane , Robert Haas References: <1873520224.1784572.1465833145330.JavaMail.yahoo.ref@mail.yahoo.com> <1873520224.1784572.1465833145330.JavaMail.yahoo@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> Cc: "David G. Johnston" , Alex Ignatov , Bruce Momjian , amul sul , PostgreSQL-development From: Artur Zakirov Message-ID: <734e50cd-c563-4afd-d1c8-80f244b3265e@postgrespro.ru> Date: Thu, 14 Jul 2016 12:05:58 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <32684.1466704957@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 On 23.06.2016 21:02, Tom Lane wrote: > Robert Haas writes: >> On Thu, Jun 23, 2016 at 1:40 PM, Tom Lane wrote: >>> At the very least I'd want to see a thought-through proposal that >>> addresses all three of these interrelated points: >>> >>> * what should a space in the format match >>> * what should a non-space, non-format-code character in the format match >>> * how should we handle fields that are not exactly the width suggested >>> by the format > >> I'm not averse to some further study of those issues, and I think the >> first two are closely related. The third one strikes me as a somewhat >> separate consideration that doesn't need to be addressed by the same >> patch. > > If you think those issues are not interrelated, you have not thought > about it carefully enough. > > As an example, what we can do to handle not-expected-width fields is > very different if the format is "DDMMYY" versus if it is "DD-MM-YY". > In the first case we have little choice but to believe that each > field is exactly two digits wide. In the second case, depending on > how we decide to define matching of "-", we might be able to allow > the field widths to vary so that they're effectively "whatever is > between the dashes". But that would require insisting that "-" > match a "-", or at least a non-alphanumeric, which is not how it > behaves today. > > I don't want to twiddle these behaviors in 9.6 and then again next year. > > regards, tom lane > > Hi, I want to start work on this patch. As a conclusion: - need a decision about three questions: > > * what should a space in the format match > * what should a non-space, non-format-code character in the format match > * how should we handle fields that are not exactly the width suggested > by the format - nobody wants solve this issue in 9.6. And I have question: what about wrong input in date argument? For example, from Alex's message: > postgres=# SELECT TO_TIMESTAMP('2016-02-30 15:43:36', 'YYYY-MM-DD > HH24:MI:SS'); > to_timestamp > ------------------------ > 2016-03-01 15:43:36+03 > (1 row) Here '2016-02-30' is wrong date. I didn't see any conclusion about this case in the thread. -- Artur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers