Re: extract (dow/week from date)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: extract (dow/week from date)
Дата
Msg-id 18897.1124589999@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: extract (dow/week from date)  (Clodoaldo Pinto <clodoaldo.pinto@gmail.com>)
Ответы Re: extract (dow/week from date)  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
Clodoaldo Pinto <clodoaldo.pinto@gmail.com> writes:
> I'm ordering by date just to show that sunday, the 0th day of the
> week, is the last day of a given week, which is not what I need.

extract(week) follows the ISO definition of week, which is pretty
strange anyway, but in particular it says that weeks start on Monday.
extract(dow) follows a different convention.  There's not a lot we
can do about this --- we're certainly not going to change extract(week),
and I can't see changing extract(dow) either.

If you feel that weeks start on Sunday you should ignore extract(week).

            regards, tom lane

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: extract (dow/week from date)
Следующее
От: Bernard
Дата:
Сообщение: CSV import issue - please help