pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alex Ignatov <a.ignatov@postgrespro.ru>
To: Albe Laurenz <laurenz.albe@wien.gv.at>
To: Tom Lane *EXTERN* <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: amul sul <sul_amul@yahoo.co.in>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Bug in to_timestamp().
Date: Fri, 24 Jun 2016 18:52:34 +0300
Message-ID: <a0c79f21-1d30-23d2-b82d-33031503c6dd@postgrespro.ru> (raw)
In-Reply-To: <A737B7A37273E048B164557ADEF4A58B53862B37@ntex2010i.host.magwien.gv.at>
References: <1873520224.1784572.1465833145330.JavaMail.yahoo.ref@mail.yahoo.com>
	<1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com>
	<20932.1465834344@sss.pgh.pa.us>
	<CA+TgmoaD8TuS=sHKS1f1qAfizCBouejgmO2jYnJ_=ia343uGSA@mail.gmail.com>
	<CA+TgmoZKJOoywaBT-K_pmQT4yPuDmR5AxjcEdwiCofA5Q3S0yA@mail.gmail.com>
	<11349.1466429771@sss.pgh.pa.us>
	<A737B7A37273E048B164557ADEF4A58B53862B37@ntex2010i.host.magwien.gv.at>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


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



view thread (138+ messages)  latest in thread

Message-ID: <a0c79f21-1d30-23d2-b82d-33031503c6dd@postgrespro.ru>
Permalink:  ../a0c79f21-1d30-23d2-b82d-33031503c6dd@postgrespro.ru/
Also on:    postgresql.org/message-id/a0c79f21-1d30-23d2-b82d-33031503c6dd@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: a.ignatov@postgrespro.ru, laurenz.albe@wien.gv.at, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, sul_amul@yahoo.co.in
  Subject: Re: Bug in to_timestamp().
  In-Reply-To: <a0c79f21-1d30-23d2-b82d-33031503c6dd@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox