On 2/21/16 2:24 PM, Vik Fearing wrote:
> On 02/21/2016 07:56 PM, Corey Huinker wrote:
>>
>> Other than that, the only difference is the ::date part. Is it
>> really worth adding extra code just for that? I would say not.
>>
>>
>> I would argue it belongs for the sake of completeness.
>
> So would I.
>
> +1 for adding this missing function.
+1. FWIW, a sample query I wrote for a customer yesterday would have
looked nicer with this function. Here's how the generate_series looked:
generate_series('2016-03-01'::date, '2016-03-31'::date, interval '1
day')::date
But it would have been cleaner to write:
generate_series('2016-03-01'::date, '2016-03-31'::date)
More importantly, though, I don't like that the timestamp version of the
function happily takes date parameters but returns timestamps. I feel
this could lead to some subtle bugs for the unwary.
--
-David
david@pgmasters.net