Re: Add generate_series(date,date) and generate_series(date,date,integer)
От | Michael Paquier |
---|---|
Тема | Re: Add generate_series(date,date) and generate_series(date,date,integer) |
Дата | |
Msg-id | CAB7nPqQUuUh_W3s55eSiMnt901Ud3meF7f_96yPkKcqfd1ZaMg@mail.gmail.com обсуждение исходный текст |
Ответ на | Add generate_series(date,date) and generate_series(date,date,integer) (Corey Huinker <corey.huinker@gmail.com>) |
Ответы |
Re: Add generate_series(date,date) and generate_series(date,date,integer)
|
Список | pgsql-hackers |
On Mon, Jan 25, 2016 at 3:00 PM, Corey Huinker <corey.huinker@gmail.com> wrote: > This patch addresses a personal need: nearly every time I use > generate_series for timestamps, I end up casting the result into date or the > ISO string thereof. Like such: > > [...] > > One thing I discovered in doing this patch is that if you do a timestamp > generate_series involving infinity....it tries to do it. I didn't wait to > see if it finished. Well, I would think that this is a bug that we had better address and backpatch. It does not make much sense to use infinity for timestamps, but letting it run infinitely is not good either. > For the date series, I put in checks to return an empty set: > > SELECT d.date_val FROM generate_series('-infinity'::date,'1999-12-29'::date) > as d(date_val); > date_val > ---------- > (0 rows) > > SELECT d.date_val FROM generate_series('1991-09-24'::date,'infinity'::date) > as d(date_val); > date_val > ---------- > (0 rows) Wouldn't a proper error be more adapted? -- Michael
В списке pgsql-hackers по дате отправления: