Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGTPQ-0006jM-24 for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jun 2016 15:52:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bGTPP-0004gj-Kz for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jun 2016 15:52: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 1bGTPO-0004g1-Bd for pgsql-hackers@postgresql.org; Fri, 24 Jun 2016 15:52:42 +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 1bGTPL-00050v-71 for pgsql-hackers@postgresql.org; Fri, 24 Jun 2016 15:52:41 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 64B6521C906E; Fri, 24 Jun 2016 18:52:38 +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 xAb3ijkF3TJE; Fri, 24 Jun 2016 18:52:37 +0300 (MSK) Received: from [192.168.27.30] (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id D6F5B21C9073; Fri, 24 Jun 2016 18:52:36 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1466783556; bh=6SKCt55VB9cxoYlx6NxbtCGOTTj1piQpPverK9C4MsQ=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=AtIPF4W1MiE0sYJieTcctJmhPzCY87CvMaVyHcu5cbTQyiwfnn1RoeWVfs8skw2Uu EChcpHLBUKg8WPybRnPTeMAFoIL04nRk738EtZjxaLoWuKZvd6PYPLeDHIR500hfN3 blKF4zWxXKc2Eg3GUYwFX9wwdtA//UfwHvq8lt3s= Subject: Re: Bug in to_timestamp(). To: Albe Laurenz , 'Tom Lane *EXTERN*' , Robert Haas References: <1873520224.1784572.1465833145330.JavaMail.yahoo.ref@mail.yahoo.com> <1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com> <20932.1465834344@sss.pgh.pa.us> <11349.1466429771@sss.pgh.pa.us> Cc: amul sul , PostgreSQL-development From: Alex Ignatov Message-ID: Date: Fri, 24 Jun 2016 18:52:34 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -3.4 (---) 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 Alex Ignatov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company On 20.06.2016 17:09, Albe Laurenz wrote: > Tom Lane wrote: >> I don't necessarily have an opinion yet. I would like to see more than >> just an unsupported assertion about what Oracle's behavior is. Also, >> how should FM mode affect this? > I can supply what Oracle 12.1 does: > > SQL> SELECT to_timestamp('2016-06-13 15:43:36', ' YYYY/MM/DD HH24:MI:SS') AS ts FROM dual; > > TS > -------------------------------- > 2016-06-13 15:43:36.000000000 AD > > SQL> SELECT to_timestamp('2016-06-13 15:43:36', 'YYYY/MM/DD HH24:MI:SS') AS ts FROM dual; > > TS > -------------------------------- > 2016-06-13 15:43:36.000000000 AD > > SQL> SELECT to_timestamp('2016-06-13 15:43:36', 'YYYY/MM/DD HH24:MI:SS') AS ts FROM dual; > > TS > -------------------------------- > 2016-06-13 15:43:36.000000000 AD > > (to_timestamp_tz behaves the same way.) > > So Oracle seems to make no difference between one or more spaces. > > Yours, > Laurenz Albe > Guys, do we need to change this behavior or may be you can tell me that is normal because this and this: 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) but on the other side we have : postgres=# select '2016-02-30 15:43:36'::timestamp; ERROR: date/time field value out of range: "2016-02-30 15:43:36" LINE 1: select '2016-02-30 15:43:36'::timestamp; Another bug in to_timestamp/date()? -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers