petropavel13 / pg_rrule

RRULE data type for PostgreSQL
MIT License
161 stars 29 forks source link

february issues #8

Open jrhite opened 8 years ago

jrhite commented 8 years ago

This does bad things (ie: the query hangs)

SELECT * FROM
     unnest(
         get_occurrences('FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=31;COUNT=10'::rrule,
             '2019-12-07 10:51:02+00'::timestamp with time zone)
     );

tested this with rrule.js and python's dateutil.rrule and they return empty lists.

groner commented 8 years ago

pg_rrule relies on libical to do this expansion. I see libical-2.0 was released and has some additional sanity checks around rrules. It isn't immediately obvious that this case is addressed.

As a practical matter, you can avoid this by providing an upper bound to your query.