Proposed changing the definition of decade for date_trunc and extract

Поиск
Список
Период
Сортировка
От Mike Swanson
Тема Proposed changing the definition of decade for date_trunc and extract
Дата
Msg-id 1406937778.11508.1.camel@gmail.com
обсуждение исходный текст
Ответы Re: Proposed changing the definition of decade for date_trunc and extract  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-hackers
For a long time (since version 8.0), PostgreSQL has adopted the logical
barriers for centuries and millenniums in these functions.  The calendar
starts millennium and century 1 on year 1, directly after 1 BC.
Unfortunately decades are still reported rather simplistically by
dividing the year by 10.  Years 1-10 are logically the first decade and
working up from there, year 2014 should be counted as 202nd decade.

I've pushed code and documentation changes to reflect this, based on the
master branch (9.5devel), it's on the branch new_decade_def at
https://github.com/chungy/postgres.git -- In both the commit message and
docs, I made note of the backwards compatibility change.  I don't know
how much of an impact this would have but I suspect not many
applications are really going to be affected by how decades are counted
(should be simple to fix on their part, if any are...).

-- Mike Swanson




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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: B-Tree support function number 3 (strxfrm() optimization)
Следующее
От: David Rowley
Дата:
Сообщение: Small patch to fix windows build