different results in to_date()

Поиск
Список
Период
Сортировка
От Jeremy Ford
Тема different results in to_date()
Дата
Msg-id F1C4C3621517E745ABCCE335DB4F4FEC4D036A@exchange.group.domain
обсуждение исходный текст
Список pgsql-bugs
Hi, I just noticed a difference in output with the to_date() function
between 8.3.7 and 8.4.B2.

=20

Running the following query on PG 8.3.7

=20

select=20

  to_char(2009,'9999') as year,=20

  to_char(3,'09') as month,=20=20

  to_date(to_char(2009,'9999')||to_char(3,'99') ,'YYYYMM') as method1,=20

  to_date(to_char(2009,'9999')||'-'||to_char(3,'09') ||
'-01','YYYY-MM-DD') as method2

=20

results in:

year, month, method1, method2

" 2009";" 03";"2009-03-01";"2009-03-01"

=20

Running exactly the same query on PG 8.4.B2 gives:

year, month, method1, method2

" 2009";" 03";"0200-09-01";"2009-03-01"

=20

PG 8.3.7    "method1" =3D "2009-03-01"

PG 8.4.B2 "method1" =3D "0200-09-01"

=20

Both databases were on the same machine - Fedora 10 - 32bit (GCC 4.3.2).
Server configured for Australian timezone/usage.

=20

I realize I should have slapped a trim() around the to_char(), but
thought it worth noting the difference anyway.

=20

Cheers,

Jeremy.

=20

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: BUG #4836: Losing data
Следующее
От: "Daniele Bortoluzzi"
Дата:
Сообщение: BUG #4838: Database corruption after btree_gin index creation