Re: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1
Дата
Msg-id 4877.1245419221@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1  ("Jeremy Ford" <jeremford@gmail.com>)
Ответы Re: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1  (Brendan Jurd <direvus@gmail.com>)
Список pgsql-bugs
"Jeremy Ford" <jeremford@gmail.com> writes:
> select
>   to_char(2009,'9999') as year,
>   to_char(3,'09') as month,
>   to_date(to_char(2009,'9999')||to_char(3,'99') ,'YYYYMM') as method1,
>   to_date(to_char(2009,'9999')||'-'||to_char(3,'09') || '-01','YYYY-MM-DD')
> as method2

Or, eliminating the extraneous stuff, the point is that

regression=# select to_date(' 2009 07', 'YYYYMM');
  to_date
------------
 0200-09-01
(1 row)

doesn't do what it used to.  Ordinarily I might say "well, if you want
leading spaces you need to say that in the format", viz

regression=# select to_date(' 2009 07', ' YYYYMM');
  to_date
------------
 2009-07-01
(1 row)

However, that just begs the question --- it seems that leading space is
allowed in MM, just not in YYYY.  Brendan, is that intentional or is it
a bug?

            regards, tom lane

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

Предыдущее
От: "Jamolkhon Khakimov"
Дата:
Сообщение: BUG #4865: replace function returns null
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4865: replace function returns null