<html><head><title>Re: Feature request: Improve allowed values for generate series</title>
</head>
<body>
<span style=" font-family:'Tahoma'; font-size: 9pt;">Hello David,<br>
<br>
I have a table with services, each service have a period. After which service is auto renewal<br>
<br>
Services also could be one-time. At this case its interval is '00:00:00'<br>
<br>
The renewal is calculated via generate_series, when interval '00:00:00' pass to that function<br>
query died =(<br>
<br>
Generate dates for one time service:<br>
test=> SELECT * FROM generate_series( '2020-11-09', '2020-11-09', INTERVAL '00:00:00' );<br>
generate_series<br>
------------------------<br>
2020-11-09 00:00:00+02<br>
(1 row)<br>
<br>
Generate dates for auto-renew service:<br>
test=> SELECT * FROM generate_series( '2020-11-09', '2020-11-10', INTERVAL '1 day' );<br>
generate_series <br>
------------------------<br>
2020-11-09 00:00:00+02<br>
2020-11-10 00:00:00+02<br>
(2 rows)<br>
<br>
So it is useful in my case. Also behavior is not surprising.<br>
<br>
<br>
<br>
Wednesday, November 11, 2020, 9:17:28 PM, you wrote:<br>
<br>
</span><table style =" border-collapse: collapse;" cellSpacing = 2>
<tr>
<td width=2 bgcolor= #0000ff style="border: 1px solid black;"><br>
</td>
<td style="border: 1px solid black;"><span style=" font-family:'Tahoma'; font-size: 9pt;">On Wed, Nov 11, 2020 at 12:12 PM Eugen Konkov <</span><a style=" font-family:'tahoma'; font-size: 9pt;" href="mailto:kes-kes(at)yandex(dot)ru">kes-kes(at)yandex(dot)ru</a><span style=" font-family:'Tahoma'; font-size: 9pt;">> wrote:<br>
</span><table style =" border-collapse: collapse;" cellSpacing = 2>
<tr>
<td width=2 bgcolor= #3200ff style="border: 1px solid black;"><br>
</td>
<td style="border: 1px solid black;"><br><br>
<span style=" font-family:'Tahoma'; font-size: 9pt;">> So I feature request to allow zero size step for cases when start point is equest to finish<br>
<br>
> What do you think?<br>
<br>
<br>
<br>
hm.... probably with step 0 we always should generate series of one<br>
value and exit, despite on finish value.<br>
Because with step 0 we always stay at current position, so there is<br>
always should be just one value.<br>
</td>
</tr>
</table>
<br>
<span style=" font-family:'Tahoma'; font-size: 9pt;">How is this better than writing "VALUES (start date)"?<br>
<br>
David J.<br>
</td>
</tr>
</table>
<br>
<br>
<br>
<span style=" font-family:'tahoma'; font-size: 9pt; color: #c0c0c0;"><i>--<br>
Best regards,<br>
Eugen Konkov</body></html>