Bug in to_timestamp().

Поиск
Список
Период
Сортировка
От amul sul
Тема Bug in to_timestamp().
Дата
Msg-id 1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com
обсуждение исходный текст
Ответы Re: Bug in to_timestamp().  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Bug in to_timestamp().  (Alex Ignatov <a.ignatov@postgrespro.ru>)
Список pgsql-hackers
Hi,

It's look like bug in to_timestamp() function when format string has more whitespaces compare to input string, see
below: 

Ex.1: Two white spaces before HH24 whereas one before input time string

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



Ex.2: One whitespace before YYYY format string

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



If there are one or more consecutive whitespace in the format, we should skip those as long as we could get an actual
field.
Thoughts?
Thanks & Regards,
Amul Sul



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: WIP: Data at rest encryption
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Reviewing freeze map code