pg_rrule
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_rrule | 0.3.0 | TYPE | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3880 | pg_rrule | No | Yes | No | Yes | No | Yes | - |
| Related | prefix semver unit pgpdf pglite_fusion md5hash asn1oid roaringbitmap |
|---|
require libical
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | MIXED | 0.3.0 | 1817161514 | pg_rrule | - |
| RPM | PIGSTY | 0.3.0 | 1817161514 | pg_rrule_$v | libical |
| DEB | PGDG | 0.3.0 | 1817161514 | postgresql-$v-pg-rrule | - |
Build
You can build the RPM packages for pg_rrule using pig build:
pig build pkg pg_rrule # build RPM packages
Install
You can install pg_rrule directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pg_rrule; # Install for current active PG version
pig ext install -y pg_rrule -v 18 # PG 18
pig ext install -y pg_rrule -v 17 # PG 17
pig ext install -y pg_rrule -v 16 # PG 16
pig ext install -y pg_rrule -v 15 # PG 15
pig ext install -y pg_rrule -v 14 # PG 14
dnf install -y pg_rrule_18 # PG 18
dnf install -y pg_rrule_17 # PG 17
dnf install -y pg_rrule_16 # PG 16
dnf install -y pg_rrule_15 # PG 15
dnf install -y pg_rrule_14 # PG 14
apt install -y postgresql-18-pg-rrule # PG 18
apt install -y postgresql-17-pg-rrule # PG 17
apt install -y postgresql-16-pg-rrule # PG 16
apt install -y postgresql-15-pg-rrule # PG 15
apt install -y postgresql-14-pg-rrule # PG 14
Create Extension:
CREATE EXTENSION pg_rrule;
Usage
pg_rrule: iCalendar RRULE recurrence rule type for PostgreSQL
The pg_rrule extension provides an RRULE data type for parsing and expanding iCalendar recurrence rules (RFC 5545).
CREATE EXTENSION pg_rrule;
Parameter Extraction
-- Get frequency
SELECT get_freq('FREQ=WEEKLY;INTERVAL=1;WKST=MO;UNTIL=20200101T045102Z'::rrule);
-- WEEKLY
-- Get days of week (numeric array)
SELECT get_byday('FREQ=WEEKLY;BYDAY=MO,TH,SU'::rrule);
-- {2,5,1}
Occurrence Generation
-- Generate occurrences from an RRULE
SELECT unnest(get_occurrences(
'FREQ=DAILY;INTERVAL=1;UNTIL=20200105T000000Z'::rrule,
'2020-01-01 00:00:00'::timestamp
));
The get_occurrences() function expands RRULE definitions into concrete timestamp sequences, supporting both timezone-aware and naive timestamp parameters.
Dependencies
Requires libical for iCalendar standard compliance.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.