Skip to content

pg_rrule

RRULE field type for PostgreSQL

pg_rrule · RRULE field type for PostgreSQL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
3880pg_rrulepg_rrule0.3.0TYPEMITC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno
require libical

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTMIXED0.3.019 18 17 16 15pg_rrule-
RPMPIGSTY0.3.019 18 17 16 15pg_rrule_$vlibical
DEBPGDG0.3.019 18 17 16 15postgresql-$v-pg-rrule-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0
el8.aarch64N/APIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0
el9.x86_64PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0
el9.aarch64PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0
el10.x86_64PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0
el10.aarch64PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0PIGSTY 0.3.0
d12.x86_64PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0
d12.aarch64PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0
d13.x86_64PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0
d13.aarch64PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0
u22.x86_64PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0
u22.aarch64PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0
u24.x86_64PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0
u24.aarch64PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0
u26.x86_64PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0
u26.aarch64PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0PGDG 0.3.0
PackageVersionOSORGSIZEFile URL
pg_rrule_180.3.0el8.x86_64pigsty31.4 KiBpg_rrule_18-0.3.0-1PGSTY.el8.x86_64.rpm
pg_rrule_180.3.0el8.aarch64pigsty32.0 KiBpg_rrule_18-0.3.0-1PGSTY.el8.aarch64.rpm
pg_rrule_180.3.0el9.x86_64pigsty32.5 KiBpg_rrule_18-0.3.0-1PGSTY.el9.x86_64.rpm
pg_rrule_180.3.0el9.aarch64pigsty32.3 KiBpg_rrule_18-0.3.0-1PGSTY.el9.aarch64.rpm
pg_rrule_180.3.0el10.x86_64pigsty32.3 KiBpg_rrule_18-0.3.0-1PGSTY.el10.x86_64.rpm
pg_rrule_180.3.0el10.aarch64pigsty32.6 KiBpg_rrule_18-0.3.0-1PGSTY.el10.aarch64.rpm
postgresql-18-pg-rrule0.3.0d12.x86_64pgdg24.4 KiBpostgresql-18-pg-rrule_0.3.0-1.pgdg12+1_amd64.deb
postgresql-18-pg-rrule0.3.0d12.aarch64pgdg24.2 KiBpostgresql-18-pg-rrule_0.3.0-1.pgdg12+1_arm64.deb
postgresql-18-pg-rrule0.3.0d13.x86_64pgdg24.3 KiBpostgresql-18-pg-rrule_0.3.0-1.pgdg13+1_amd64.deb
postgresql-18-pg-rrule0.3.0d13.aarch64pgdg24.3 KiBpostgresql-18-pg-rrule_0.3.0-1.pgdg13+1_arm64.deb
postgresql-18-pg-rrule0.3.0u22.x86_64pgdg24.2 KiBpostgresql-18-pg-rrule_0.3.0-1.pgdg22.04+1_amd64.deb
postgresql-18-pg-rrule0.3.0u22.aarch64pgdg23.5 KiBpostgresql-18-pg-rrule_0.3.0-1.pgdg22.04+1_arm64.deb
postgresql-18-pg-rrule0.3.0u24.x86_64pgdg24.4 KiBpostgresql-18-pg-rrule_0.3.0-1.pgdg24.04+1_amd64.deb
postgresql-18-pg-rrule0.3.0u24.aarch64pgdg24.1 KiBpostgresql-18-pg-rrule_0.3.0-1.pgdg24.04+1_arm64.deb
postgresql-18-pg-rrule0.3.0u26.x86_64pgdg24.1 KiBpostgresql-18-pg-rrule_0.3.0-1.pgdg26.04+1_amd64.deb
postgresql-18-pg-rrule0.3.0u26.aarch64pgdg24.7 KiBpostgresql-18-pg-rrule_0.3.0-1.pgdg26.04+1_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_rrule_170.3.0el8.x86_64pigsty31.6 KiBpg_rrule_17-0.3.0-1PGSTY.el8.x86_64.rpm
pg_rrule_170.3.0el8.aarch64pigsty31.9 KiBpg_rrule_17-0.3.0-1PGSTY.el8.aarch64.rpm
pg_rrule_170.3.0el9.x86_64pigsty32.4 KiBpg_rrule_17-0.3.0-1PGSTY.el9.x86_64.rpm
pg_rrule_170.3.0el9.aarch64pigsty32.3 KiBpg_rrule_17-0.3.0-1PGSTY.el9.aarch64.rpm
pg_rrule_170.3.0el10.x86_64pigsty32.4 KiBpg_rrule_17-0.3.0-1PGSTY.el10.x86_64.rpm
pg_rrule_170.3.0el10.aarch64pigsty32.6 KiBpg_rrule_17-0.3.0-1PGSTY.el10.aarch64.rpm
postgresql-17-pg-rrule0.3.0d12.x86_64pgdg24.5 KiBpostgresql-17-pg-rrule_0.3.0-1.pgdg12+1_amd64.deb
postgresql-17-pg-rrule0.3.0d12.aarch64pgdg24.2 KiBpostgresql-17-pg-rrule_0.3.0-1.pgdg12+1_arm64.deb
postgresql-17-pg-rrule0.3.0d13.x86_64pgdg24.4 KiBpostgresql-17-pg-rrule_0.3.0-1.pgdg13+1_amd64.deb
postgresql-17-pg-rrule0.3.0d13.aarch64pgdg24.3 KiBpostgresql-17-pg-rrule_0.3.0-1.pgdg13+1_arm64.deb
postgresql-17-pg-rrule0.3.0u22.x86_64pgdg25.0 KiBpostgresql-17-pg-rrule_0.3.0-1.pgdg22.04+1_amd64.deb
postgresql-17-pg-rrule0.3.0u22.aarch64pgdg25.1 KiBpostgresql-17-pg-rrule_0.3.0-1.pgdg22.04+1_arm64.deb
postgresql-17-pg-rrule0.3.0u24.x86_64pgdg24.4 KiBpostgresql-17-pg-rrule_0.3.0-1.pgdg24.04+1_amd64.deb
postgresql-17-pg-rrule0.3.0u24.aarch64pgdg24.1 KiBpostgresql-17-pg-rrule_0.3.0-1.pgdg24.04+1_arm64.deb
postgresql-17-pg-rrule0.3.0u26.x86_64pgdg24.2 KiBpostgresql-17-pg-rrule_0.3.0-1.pgdg26.04+1_amd64.deb
postgresql-17-pg-rrule0.3.0u26.aarch64pgdg24.8 KiBpostgresql-17-pg-rrule_0.3.0-1.pgdg26.04+1_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_rrule_160.3.0el8.x86_64pigsty31.6 KiBpg_rrule_16-0.3.0-1PGSTY.el8.x86_64.rpm
pg_rrule_160.3.0el8.aarch64pigsty31.9 KiBpg_rrule_16-0.3.0-1PGSTY.el8.aarch64.rpm
pg_rrule_160.3.0el9.x86_64pigsty32.4 KiBpg_rrule_16-0.3.0-1PGSTY.el9.x86_64.rpm
pg_rrule_160.3.0el9.aarch64pigsty32.3 KiBpg_rrule_16-0.3.0-1PGSTY.el9.aarch64.rpm
pg_rrule_160.3.0el10.x86_64pigsty32.4 KiBpg_rrule_16-0.3.0-1PGSTY.el10.x86_64.rpm
pg_rrule_160.3.0el10.aarch64pigsty32.6 KiBpg_rrule_16-0.3.0-1PGSTY.el10.aarch64.rpm
postgresql-16-pg-rrule0.3.0d12.x86_64pgdg24.4 KiBpostgresql-16-pg-rrule_0.3.0-1.pgdg12+1_amd64.deb
postgresql-16-pg-rrule0.3.0d12.aarch64pgdg24.2 KiBpostgresql-16-pg-rrule_0.3.0-1.pgdg12+1_arm64.deb
postgresql-16-pg-rrule0.3.0d13.x86_64pgdg24.4 KiBpostgresql-16-pg-rrule_0.3.0-1.pgdg13+1_amd64.deb
postgresql-16-pg-rrule0.3.0d13.aarch64pgdg24.3 KiBpostgresql-16-pg-rrule_0.3.0-1.pgdg13+1_arm64.deb
postgresql-16-pg-rrule0.3.0u22.x86_64pgdg25.0 KiBpostgresql-16-pg-rrule_0.3.0-1.pgdg22.04+1_amd64.deb
postgresql-16-pg-rrule0.3.0u22.aarch64pgdg25.1 KiBpostgresql-16-pg-rrule_0.3.0-1.pgdg22.04+1_arm64.deb
postgresql-16-pg-rrule0.3.0u24.x86_64pgdg24.4 KiBpostgresql-16-pg-rrule_0.3.0-1.pgdg24.04+1_amd64.deb
postgresql-16-pg-rrule0.3.0u24.aarch64pgdg24.1 KiBpostgresql-16-pg-rrule_0.3.0-1.pgdg24.04+1_arm64.deb
postgresql-16-pg-rrule0.3.0u26.x86_64pgdg24.2 KiBpostgresql-16-pg-rrule_0.3.0-1.pgdg26.04+1_amd64.deb
postgresql-16-pg-rrule0.3.0u26.aarch64pgdg24.8 KiBpostgresql-16-pg-rrule_0.3.0-1.pgdg26.04+1_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_rrule_150.3.0el8.x86_64pigsty31.6 KiBpg_rrule_15-0.3.0-1PGSTY.el8.x86_64.rpm
pg_rrule_150.3.0el8.aarch64pigsty31.9 KiBpg_rrule_15-0.3.0-1PGSTY.el8.aarch64.rpm
pg_rrule_150.3.0el9.x86_64pigsty32.6 KiBpg_rrule_15-0.3.0-1PGSTY.el9.x86_64.rpm
pg_rrule_150.3.0el9.aarch64pigsty32.4 KiBpg_rrule_15-0.3.0-1PGSTY.el9.aarch64.rpm
pg_rrule_150.3.0el10.x86_64pigsty32.6 KiBpg_rrule_15-0.3.0-1PGSTY.el10.x86_64.rpm
pg_rrule_150.3.0el10.aarch64pigsty32.7 KiBpg_rrule_15-0.3.0-1PGSTY.el10.aarch64.rpm
postgresql-15-pg-rrule0.3.0d12.x86_64pgdg24.4 KiBpostgresql-15-pg-rrule_0.3.0-1.pgdg12+1_amd64.deb
postgresql-15-pg-rrule0.3.0d12.aarch64pgdg24.2 KiBpostgresql-15-pg-rrule_0.3.0-1.pgdg12+1_arm64.deb
postgresql-15-pg-rrule0.3.0d13.x86_64pgdg24.3 KiBpostgresql-15-pg-rrule_0.3.0-1.pgdg13+1_amd64.deb
postgresql-15-pg-rrule0.3.0d13.aarch64pgdg24.3 KiBpostgresql-15-pg-rrule_0.3.0-1.pgdg13+1_arm64.deb
postgresql-15-pg-rrule0.3.0u22.x86_64pgdg25.1 KiBpostgresql-15-pg-rrule_0.3.0-1.pgdg22.04+1_amd64.deb
postgresql-15-pg-rrule0.3.0u22.aarch64pgdg24.6 KiBpostgresql-15-pg-rrule_0.3.0-1.pgdg22.04+1_arm64.deb
postgresql-15-pg-rrule0.3.0u24.x86_64pgdg24.5 KiBpostgresql-15-pg-rrule_0.3.0-1.pgdg24.04+1_amd64.deb
postgresql-15-pg-rrule0.3.0u24.aarch64pgdg24.3 KiBpostgresql-15-pg-rrule_0.3.0-1.pgdg24.04+1_arm64.deb
postgresql-15-pg-rrule0.3.0u26.x86_64pgdg24.3 KiBpostgresql-15-pg-rrule_0.3.0-1.pgdg26.04+1_amd64.deb
postgresql-15-pg-rrule0.3.0u26.aarch64pgdg24.9 KiBpostgresql-15-pg-rrule_0.3.0-1.pgdg26.04+1_arm64.deb

Source

pig build pkg pg_rrule;		# build rpm

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pg_rrule;		# install by package name

pig install pg_rrule -v 19;   # install for PG 19
pig install pg_rrule -v 18;   # install for PG 18
pig install pg_rrule -v 17;   # install for PG 17
pig install pg_rrule -v 16;   # install for PG 16
pig install pg_rrule -v 15;   # install for PG 15

Create this extension with:

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.

Table reader