Re: Re: Add generate_series(date, date) and generate_series(date, date, integer)

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Re: Add generate_series(date, date) and generate_series(date, date, integer)
Дата
Msg-id CANP8+jKcxi=NWf-vxAu+MGTTv+yKLC=b+MxqKAgAT1nQhBKogQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Re: Add generate_series(date, date) and generate_series(date, date, integer)  (Corey Huinker <corey.huinker@gmail.com>)
Ответы Re: Re: Add generate_series(date, date) and generate_series(date, date, integer)  (Corey Huinker <corey.huinker@gmail.com>)
Список pgsql-hackers
On 2 February 2016 at 18:01, Corey Huinker <corey.huinker@gmail.com> wrote:
Doh, I left that comment to myself in there. :)

The corresponding structs in timestamp.c and int.c have no comment, so suggestions of what should be there are welcome. In the interim I put in this:
/* state for generate_series_date(date,date,[step]) */

Extra linefeed after struct removed.

Do you have any insight as to why the documentation test failed?

In the mean time, here's the updated patch.

[step] is in days, but is not documented as such.

My understanding is you want to replace this

SELECT d.dt::date as dt
FROM generate_series('2015-01-01'::date,
                     '2016-01-04'::date
                     interval '1 day') AS d(dt);

with this

SELECT d.dt
FROM generate_series('
2015-01-01'::date,
                     '2016-01-04'::date,
                     7) as d(dt);
 
Personally, I think writing  INTERVAL '7 days' to be clearer than just typing 7.

Other than that, the only difference is the ::date part. Is it really worth adding extra code just for that? I would say not.

No comments on the patch itself, which seems to do the job, so apologies to give this opinion on your work, I do hope it doesn't put you off further contributions.

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Spurious standby query cancellations
Следующее
От: Robert Haas
Дата:
Сообщение: Re: checkpointer continuous flushing - V18