From: | David Steele <david(at)pgmasters(dot)net> |
---|---|
To: | Vik Fearing <vik(at)2ndquadrant(dot)fr>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Re: Add generate_series(date, date) and generate_series(date, date, integer) |
Date: | 2016-03-04 19:14:34 |
Message-ID: | 56D9DE9A.7060303@pgmasters.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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(at)pgmasters(dot)net
From | Date | Subject | |
---|---|---|---|
Next Message | Stas Kelvich | 2016-03-04 19:26:31 | Re: transam README small fix |
Previous Message | Robert Haas | 2016-03-04 19:14:31 | Re: transam README small fix |