BUG #6126: CC parameter in to_char() behaves incorrectly

Поиск
Список
Период
Сортировка
От Artem Andreev
Тема BUG #6126: CC parameter in to_char() behaves incorrectly
Дата
Msg-id 201107210840.p6L8eBeA041492@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #6126: CC parameter in to_char() behaves incorrectly  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      6126
Logged by:          Artem Andreev
Email address:      artem@oktetlabs.ru
PostgreSQL version: 9.0.4
Operating system:   Debian 6.0
Description:        CC parameter in to_char() behaves incorrectly
Details:

CC parameter in to_char() behaves incorrectly with BC dates:

1st century BC:

select to_char('0002-01-01 00:00:00 BC' :: timestamp, 'CC');
====>
 to_char
---------
 01

2nd century BC:

 select to_char('0101-01-01 00:00:00 BC' :: timestamp, 'CC');
=====>
 to_char
---------
 00

3rd century BC:
iliran=> select to_char('0301-01-01 00:00:00 BC' :: timestamp, 'CC');
 to_char
---------
 -2

In all these cases EXTRACT(CENTURY FROM ...) yields the expected result

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: BUG #6086: Segmentation fault
Следующее
От: "Greg Johnson"
Дата:
Сообщение: BUG #6127: pg_restore failing: unexpected message type 0x58 during COPY from stdin