Re: generate_series() Interpretation

Поиск
Список
Период
Сортировка
Искать
От
Michael Nolan
Тема
Re: generate_series() Interpretation
Дата
Msg-id
BANLkTi=y6jPhB506r2YvKwb7UBYgnCuw8A@mail.gmail.com
Ответ на
Список
Дерево обсуждения
generate_series() Interpretation "David E. Wheeler" <david@kineticode.com>
Re: generate_series() Interpretation "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: generate_series() Interpretation "David E. Wheeler" <david@kineticode.com>
Re: generate_series() Interpretation Steve Crawford <scrawford@pinpointresearch.com>
Re: generate_series() Interpretation "David E. Wheeler" <david@kineticode.com>
Re: generate_series() Interpretation Steve Crawford <scrawford@pinpointresearch.com>
Re: generate_series() Interpretation "David E. Wheeler" <david@kineticode.com>
Re: generate_series() Interpretation Steve Crawford <scrawford@pinpointresearch.com>
Re: generate_series() Interpretation Michael Nolan <htfoot@gmail.com>
Re: generate_series() Interpretation Christopher Browne <cbbrowne@gmail.com>
Re: generate_series() Interpretation "David E. Wheeler" <david@kineticode.com>
Re: generate_series() Interpretation Christopher Browne <cbbrowne@gmail.com>


On Mon, Jun 27, 2011 at 1:38 PM, David E. Wheeler <david@kineticode.com> wrote:

Yeah, which is why I said it was subject to interpretation. Of course there's no way to tell generate_series() which to use, which is what I figured.

generate_series() is doing exactly what it was designed to do, the imprecision regarding adding '1 month' to something that may or may not have been intended to be 'last day of the month' is a limitation in the interval code.

One way to change this would be to implement another interval type such as 'full_month'  which would take a date that is know to be the last day of the month and make it the last day of the appropriate month.  If the starting date is NOT the last day of a month, the existing logic would suffice. 

Or you can do as I have done and create your own last_day() function that takes any date and makes it the last day of that month, and apply it to the output of generate_series();
--
Mike Nolan
nolan@tssi.com

В списке pgsql-hackers по дате отправления
От: Noah Misch
Дата:
От: Steve Crawford
Дата:
FAQ