Re: BUG #6219: date_part() function producting incorrect year

Поиск
Список
Период
Сортировка
От Guillaume Smet
Тема Re: BUG #6219: date_part() function producting incorrect year
Дата
Msg-id CALt0+o8+A_pPgpUkTtPcXn8y3O96Cn8sDLyz+1U=ZF9ZZ2Aopw@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #6219: date_part() function producting incorrect year  ("Eric Vollnogel" <edvollnogel@dstsystems.com>)
Список pgsql-bugs
On Wed, Sep 21, 2011 at 11:17 PM, Eric Vollnogel
<edvollnogel@dstsystems.com> wrote:
> The date_part('isoyear', some_column) function is not always returning the
> correct result. =A0See below:

See http://www.postgresql.org/docs/8.4/static/functions-datetime.html :
"Each ISO year begins with the Monday of the week containing the 4th
of January, so in early January or late December the ISO year may be
different from the Gregorian year. See the week field for more
information."

So ISO year 2011 starts on Monday the 3rd of January.

If you want the Gregorian year, just user 'year' instead of 'isoyear'.

--=20
Guillaume

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

Предыдущее
От: "Eric Vollnogel"
Дата:
Сообщение: BUG #6219: date_part() function producting incorrect year
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Broken selectivity with special inet operators