pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: amul sul <sul_amul@yahoo.co.in>
To: Alex Ignatov <a.ignatov@postgrespro.ru>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Bug in to_timestamp().
Date: Thu, 23 Jun 2016 07:41:26 +0000 (UTC)
Message-ID: <884791796.213185.1466667686999.JavaMail.yahoo@mail.yahoo.com> (raw)
In-Reply-To: <f64563b3-5c3c-6f28-3f73-41b2159417bc@postgrespro.ru>
References: <1873520224.1784572.1465833145330.JavaMail.yahoo.ref@mail.yahoo.com>
	<1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com>
	<f64563b3-5c3c-6f28-3f73-41b2159417bc@postgrespro.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On Monday, 20 June 2016 8:53 PM, Alex Ignatov <a.ignatov@postgrespro.ru> wrote:


>>On 13.06.2016 18:52, amul sul wrote:
>And it wont stop on some simple whitespace. By using to_timestamp you 
>can get any output results by providing illegal input parameters values:

>postgres=# SELECT TO_TIMESTAMP('2016-06-13 99:99:99', 'YYYYMMDD 
>HH24:MI:SS');
>       to_timestamp
>------------------------
>  2016-01-06 14:40:39+03
>
> (1 row)

We do consume extra space from input string, but not if it is in format string, see below:

postgres=# SELECT TO_TIMESTAMP('2016-06-13      15:43:36', 'YYYY/MM/DD HH24:MI:SS'); 
to_timestamp 
------------------------
2016-06-13 15:43:36-07
(1 row)

We should have same treatment for format string too.

Thoughts? Comments?

Regards,
Amul Sul


-- 
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: <884791796.213185.1466667686999.JavaMail.yahoo@mail.yahoo.com>
Permalink:  ../884791796.213185.1466667686999.JavaMail.yahoo@mail.yahoo.com/
Also on:    postgresql.org/message-id/884791796.213185.1466667686999.JavaMail.yahoo@mail.yahoo.com

 · 

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: sul_amul@yahoo.co.in, a.ignatov@postgrespro.ru
  Subject: Re: Bug in to_timestamp().
  In-Reply-To: <884791796.213185.1466667686999.JavaMail.yahoo@mail.yahoo.com>

* 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