st 11. 11. 2020 v 19:59 odesílatel Eugen Konkov <kes-...@yandex.ru> napsal:

> 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?
>

What is the real use case?  Current implementation is very simple -
increment should not be zero, and then we know so there is no infinity
cycle.

Regards

Pavel




>
> --
> Best regards,
> Eugen Konkov
>
>
>
>

Reply via email to