Re: BUG #14294: Problem in generate series between dates - Mailing list pgsql-bugs

From Andrew Gierth
Subject Re: BUG #14294: Problem in generate series between dates
Date
Msg-id 878tvc4nk4.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: BUG #14294: Problem in generate series between dates  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #14294: Problem in generate series between dates  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-bugs
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 >> The lack of generate_series(date,date,integer) is sometimes
 >> annoying, even though it can be worked around using the
 >> timestamp-without-timezone variant of generate_series.

 Tom> Or you can do it with "base_date + generate_series(integer...)".

 Tom> I think we looked at this when the timestamp generate_series
 Tom> functions were put in, and were worried about overloading the name
 Tom> so far that common use-cases would get ambiguous-function
 Tom> failures.  If that can be shown not to happen, though, it'd be
 Tom> worth adding such a function IMO.

I don't see why there would be ambiguity. date_part already has
overloads for every date/time type without causing any issues (but
date_trunc does not, which is another source of subtle timezone bugs).

Some experimentation with creating
pg_catalog.generate_series(date,date,integer) and trying the usual
use-cases doesn't seem to turn up any issues. Looking at the list of
implicit casts also doesn't suggest that there would be any problems.

--
Andrew (irc:RhodiumToad)

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #14294: Problem in generate series between dates
Next
From: Dean Rasheed
Date:
Subject: Re: BUG #14294: Problem in generate series between dates