rrule_safe
pg-rrule-safe · Memory-safe iCalendar recurrence-rule evaluation for PostgreSQL.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101955 | rrule_safe | pg-rrule-safe | 0.2.1 | TYPE | PostgreSQL | Rust |
PostgreSQL · 13, 14, 15, 16, 17, 18
Usage
Sources:
rrule_safe evaluates iCalendar recurrence rules inside PostgreSQL with a Rust implementation intended as a memory-safe replacement for the unmaintained pg_rrule library.
Enablement
Release 0.2.1 supports PostgreSQL 13–18 through pgrx 0.18.0. Install its files for the exact PostgreSQL major, then create the extension as a superuser:
The control file is non-relocatable, untrusted, and loads rrule_safe; it does not require preloading or a server restart.
Recurrence Expansion
get_occurrences accepts an RRULE string, a start timestamp, and an optional inclusive upper bound. Timestamp and timestamp-with-time-zone overloads return arrays of matching occurrences.
For compatibility, the extension defines rrule as a domain over text; it does not reproduce pg_rrule’s stored custom type. Migrate persisted legacy values explicitly.
Safety Boundary
Unbounded or malformed recurrence rules can be expensive. rrule_safe.limit caps the number of returned occurrences and defaults to 65,535. Set a lower session value for user-controlled rules, and always supply an upper bound where the application has one.