Hello Eugen,

Wednesday, November 11, 2020, 8:50:59 PM, you wrote:

> Hello Pgsql-hackers,

> Seems I fall into corner case:

test=>> SELECT * FROM generate_series( '2020-11-09', '2020-11-09', INTERVAL 
'00:00:00' );
> ERROR:  step size cannot equal zero

> But:
test=>> SELECT * FROM generate_series( '2020-11-09', '2020-11-10', INTERVAL '1 
day' );
>     generate_series     
> ------------------------
>  2020-11-09 00:00:00+02
>  2020-11-10 00:00:00+02
> (2 rows)

> Here  we  start  at  2020-11-09, add interval of one day and finish at 
> 2020-11-10
> Done! series is generated.

> In  first  case  I  expect that I start at 2020-11-09, add interval of zero 
> and finish at 2020-11-09
> Everything is consistent.

test=>> SELECT * FROM generate_series( '2020-11-09', '2020-11-09', INTERVAL 
'00:00:00' );
>     generate_series
> ------------------------
>  2020-11-09 00:00:00+02
> (1 row)


> So   I   feature  request  to  allow  zero size step for cases when start 
> point is equest to finish

> What do you think?



hm....  probably  with  step 0 we always should generate series of one
value and exit, despite on finish value.
Because  with  step  0 we always stay at current position, so there is
always should be just one value.

-- 
Best regards,
Eugen Konkov



Reply via email to