Skip to content

pg_ical

RRULE recurrence functions for PostgreSQL backed by libical

pg_ical · RRULE recurrence functions for PostgreSQL backed by libical

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101064pg_icalpg_ical0.2.0TIMEMITC

PostgreSQL · 11, 12

Usage

Sources:

pg_ical adds functions for RFC 5545 recurrence rules backed by libical. It parses RRULE fields and expands recurring events, including recurrence dates, exclusion dates, time zones, durations, and recurrence identifiers.

CREATE EXTENSION pg_ical;
SELECT get_freq('FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TH');
SELECT unnest(get_occurrences(
  'FREQ=DAILY;COUNT=3',
  '2026-01-01 09:00:00+00'::timestamptz
));

The reviewed version is 0.2.0 and upstream explicitly does not support the deprecated EXRULE feature. Calendar correctness depends on RFC interpretation, libical version, daylight-saving transitions, inclusive boundaries, and timestamp type. Test real time zones and recurrence limits, and cap expansions generated from untrusted rules.

Table reader