Skip to content

pgcalendar

Recurring calendar, schedule, and exception management for PostgreSQL

pgcalendar · Recurring calendar, schedule, and exception management for PostgreSQL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
3890pgcalendarpgcalendar1.1.0TYPEMITSQL
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
----d--NoNoNoYesnono
Deb/RPM recipes patch the stale upstream 1.1.0 control metadata (default_version/module_pathname).

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.1.019 18 17 16 15pgcalendar-
RPMPIGSTY1.1.019 18 17 16 15pgcalendar_$v-
DEBPIGSTY1.1.019 18 17 16 15postgresql-$v-pgcalendar-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
el8.aarch64N/APIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
el9.x86_64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
el9.aarch64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
el10.x86_64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
el10.aarch64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
d12.x86_64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
d12.aarch64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
d13.x86_64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
d13.aarch64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
u22.x86_64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
u22.aarch64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
u24.x86_64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
u24.aarch64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
u26.x86_64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
u26.aarch64PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0PIGSTY 1.1.0
PackageVersionOSORGSIZEFile URL
pgcalendar_191.1.0el9.x86_64pigsty13.4 KiBpgcalendar_19-1.1.0-1PGSTY.el9.noarch.rpm
pgcalendar_191.1.0el9.aarch64pigsty13.4 KiBpgcalendar_19-1.1.0-1PGSTY.el9.noarch.rpm
pgcalendar_191.1.0el10.x86_64pigsty13.5 KiBpgcalendar_19-1.1.0-1PGSTY.el10.noarch.rpm
pgcalendar_191.1.0el10.aarch64pigsty13.5 KiBpgcalendar_19-1.1.0-1PGSTY.el10.noarch.rpm
postgresql-19-pgcalendar1.1.0d12.x86_64pigsty7.3 KiBpostgresql-19-pgcalendar_1.1.0-1PGSTY~bookworm_all.deb
postgresql-19-pgcalendar1.1.0d12.aarch64pigsty7.3 KiBpostgresql-19-pgcalendar_1.1.0-1PGSTY~bookworm_all.deb
postgresql-19-pgcalendar1.1.0d13.x86_64pigsty7.3 KiBpostgresql-19-pgcalendar_1.1.0-1PGSTY~trixie_all.deb
postgresql-19-pgcalendar1.1.0d13.aarch64pigsty7.3 KiBpostgresql-19-pgcalendar_1.1.0-1PGSTY~trixie_all.deb
postgresql-19-pgcalendar1.1.0u22.x86_64pigsty7.4 KiBpostgresql-19-pgcalendar_1.1.0-1PGSTY~jammy_all.deb
postgresql-19-pgcalendar1.1.0u22.aarch64pigsty7.4 KiBpostgresql-19-pgcalendar_1.1.0-1PGSTY~jammy_all.deb
postgresql-19-pgcalendar1.1.0u24.x86_64pigsty7.4 KiBpostgresql-19-pgcalendar_1.1.0-1PGSTY~noble_all.deb
postgresql-19-pgcalendar1.1.0u24.aarch64pigsty7.4 KiBpostgresql-19-pgcalendar_1.1.0-1PGSTY~noble_all.deb
postgresql-19-pgcalendar1.1.0u26.x86_64pigsty7.4 KiBpostgresql-19-pgcalendar_1.1.0-1PGSTY~resolute_all.deb
postgresql-19-pgcalendar1.1.0u26.aarch64pigsty7.4 KiBpostgresql-19-pgcalendar_1.1.0-1PGSTY~resolute_all.deb
PackageVersionOSORGSIZEFile URL
pgcalendar_181.1.0el8.x86_64pigsty13.5 KiBpgcalendar_18-1.1.0-1PGSTY.el8.noarch.rpm
pgcalendar_181.1.0el8.aarch64pigsty13.5 KiBpgcalendar_18-1.1.0-1PGSTY.el8.noarch.rpm
pgcalendar_181.1.0el9.x86_64pigsty13.4 KiBpgcalendar_18-1.1.0-1PGSTY.el9.noarch.rpm
pgcalendar_181.1.0el9.aarch64pigsty13.4 KiBpgcalendar_18-1.1.0-1PGSTY.el9.noarch.rpm
pgcalendar_181.1.0el10.x86_64pigsty13.5 KiBpgcalendar_18-1.1.0-1PGSTY.el10.noarch.rpm
pgcalendar_181.1.0el10.aarch64pigsty13.5 KiBpgcalendar_18-1.1.0-1PGSTY.el10.noarch.rpm
postgresql-18-pgcalendar1.1.0d12.x86_64pigsty7.3 KiBpostgresql-18-pgcalendar_1.1.0-1PGSTY~bookworm_all.deb
postgresql-18-pgcalendar1.1.0d12.aarch64pigsty7.3 KiBpostgresql-18-pgcalendar_1.1.0-1PGSTY~bookworm_all.deb
postgresql-18-pgcalendar1.1.0d13.x86_64pigsty7.3 KiBpostgresql-18-pgcalendar_1.1.0-1PGSTY~trixie_all.deb
postgresql-18-pgcalendar1.1.0d13.aarch64pigsty7.3 KiBpostgresql-18-pgcalendar_1.1.0-1PGSTY~trixie_all.deb
postgresql-18-pgcalendar1.1.0u22.x86_64pigsty7.4 KiBpostgresql-18-pgcalendar_1.1.0-1PGSTY~jammy_all.deb
postgresql-18-pgcalendar1.1.0u22.aarch64pigsty7.4 KiBpostgresql-18-pgcalendar_1.1.0-1PGSTY~jammy_all.deb
postgresql-18-pgcalendar1.1.0u24.x86_64pigsty7.4 KiBpostgresql-18-pgcalendar_1.1.0-1PGSTY~noble_all.deb
postgresql-18-pgcalendar1.1.0u24.aarch64pigsty7.4 KiBpostgresql-18-pgcalendar_1.1.0-1PGSTY~noble_all.deb
postgresql-18-pgcalendar1.1.0u26.x86_64pigsty7.4 KiBpostgresql-18-pgcalendar_1.1.0-1PGSTY~resolute_all.deb
postgresql-18-pgcalendar1.1.0u26.aarch64pigsty7.4 KiBpostgresql-18-pgcalendar_1.1.0-1PGSTY~resolute_all.deb
PackageVersionOSORGSIZEFile URL
pgcalendar_171.1.0el8.x86_64pigsty13.5 KiBpgcalendar_17-1.1.0-1PGSTY.el8.noarch.rpm
pgcalendar_171.1.0el8.aarch64pigsty13.5 KiBpgcalendar_17-1.1.0-1PGSTY.el8.noarch.rpm
pgcalendar_171.1.0el9.x86_64pigsty13.4 KiBpgcalendar_17-1.1.0-1PGSTY.el9.noarch.rpm
pgcalendar_171.1.0el9.aarch64pigsty13.4 KiBpgcalendar_17-1.1.0-1PGSTY.el9.noarch.rpm
pgcalendar_171.1.0el10.x86_64pigsty13.5 KiBpgcalendar_17-1.1.0-1PGSTY.el10.noarch.rpm
pgcalendar_171.1.0el10.aarch64pigsty13.5 KiBpgcalendar_17-1.1.0-1PGSTY.el10.noarch.rpm
postgresql-17-pgcalendar1.1.0d12.x86_64pigsty7.3 KiBpostgresql-17-pgcalendar_1.1.0-1PGSTY~bookworm_all.deb
postgresql-17-pgcalendar1.1.0d12.aarch64pigsty7.3 KiBpostgresql-17-pgcalendar_1.1.0-1PGSTY~bookworm_all.deb
postgresql-17-pgcalendar1.1.0d13.x86_64pigsty7.3 KiBpostgresql-17-pgcalendar_1.1.0-1PGSTY~trixie_all.deb
postgresql-17-pgcalendar1.1.0d13.aarch64pigsty7.3 KiBpostgresql-17-pgcalendar_1.1.0-1PGSTY~trixie_all.deb
postgresql-17-pgcalendar1.1.0u22.x86_64pigsty7.4 KiBpostgresql-17-pgcalendar_1.1.0-1PGSTY~jammy_all.deb
postgresql-17-pgcalendar1.1.0u22.aarch64pigsty7.4 KiBpostgresql-17-pgcalendar_1.1.0-1PGSTY~jammy_all.deb
postgresql-17-pgcalendar1.1.0u24.x86_64pigsty7.4 KiBpostgresql-17-pgcalendar_1.1.0-1PGSTY~noble_all.deb
postgresql-17-pgcalendar1.1.0u24.aarch64pigsty7.4 KiBpostgresql-17-pgcalendar_1.1.0-1PGSTY~noble_all.deb
postgresql-17-pgcalendar1.1.0u26.x86_64pigsty7.4 KiBpostgresql-17-pgcalendar_1.1.0-1PGSTY~resolute_all.deb
postgresql-17-pgcalendar1.1.0u26.aarch64pigsty7.4 KiBpostgresql-17-pgcalendar_1.1.0-1PGSTY~resolute_all.deb
PackageVersionOSORGSIZEFile URL
pgcalendar_161.1.0el8.x86_64pigsty13.5 KiBpgcalendar_16-1.1.0-1PGSTY.el8.noarch.rpm
pgcalendar_161.1.0el8.aarch64pigsty13.5 KiBpgcalendar_16-1.1.0-1PGSTY.el8.noarch.rpm
pgcalendar_161.1.0el9.x86_64pigsty13.4 KiBpgcalendar_16-1.1.0-1PGSTY.el9.noarch.rpm
pgcalendar_161.1.0el9.aarch64pigsty13.4 KiBpgcalendar_16-1.1.0-1PGSTY.el9.noarch.rpm
pgcalendar_161.1.0el10.x86_64pigsty13.5 KiBpgcalendar_16-1.1.0-1PGSTY.el10.noarch.rpm
pgcalendar_161.1.0el10.aarch64pigsty13.5 KiBpgcalendar_16-1.1.0-1PGSTY.el10.noarch.rpm
postgresql-16-pgcalendar1.1.0d12.x86_64pigsty7.3 KiBpostgresql-16-pgcalendar_1.1.0-1PGSTY~bookworm_all.deb
postgresql-16-pgcalendar1.1.0d12.aarch64pigsty7.3 KiBpostgresql-16-pgcalendar_1.1.0-1PGSTY~bookworm_all.deb
postgresql-16-pgcalendar1.1.0d13.x86_64pigsty7.3 KiBpostgresql-16-pgcalendar_1.1.0-1PGSTY~trixie_all.deb
postgresql-16-pgcalendar1.1.0d13.aarch64pigsty7.3 KiBpostgresql-16-pgcalendar_1.1.0-1PGSTY~trixie_all.deb
postgresql-16-pgcalendar1.1.0u22.x86_64pigsty7.4 KiBpostgresql-16-pgcalendar_1.1.0-1PGSTY~jammy_all.deb
postgresql-16-pgcalendar1.1.0u22.aarch64pigsty7.4 KiBpostgresql-16-pgcalendar_1.1.0-1PGSTY~jammy_all.deb
postgresql-16-pgcalendar1.1.0u24.x86_64pigsty7.4 KiBpostgresql-16-pgcalendar_1.1.0-1PGSTY~noble_all.deb
postgresql-16-pgcalendar1.1.0u24.aarch64pigsty7.4 KiBpostgresql-16-pgcalendar_1.1.0-1PGSTY~noble_all.deb
postgresql-16-pgcalendar1.1.0u26.x86_64pigsty7.4 KiBpostgresql-16-pgcalendar_1.1.0-1PGSTY~resolute_all.deb
postgresql-16-pgcalendar1.1.0u26.aarch64pigsty7.4 KiBpostgresql-16-pgcalendar_1.1.0-1PGSTY~resolute_all.deb
PackageVersionOSORGSIZEFile URL
pgcalendar_151.1.0el8.x86_64pigsty13.5 KiBpgcalendar_15-1.1.0-1PGSTY.el8.noarch.rpm
pgcalendar_151.1.0el8.aarch64pigsty13.5 KiBpgcalendar_15-1.1.0-1PGSTY.el8.noarch.rpm
pgcalendar_151.1.0el9.x86_64pigsty13.4 KiBpgcalendar_15-1.1.0-1PGSTY.el9.noarch.rpm
pgcalendar_151.1.0el9.aarch64pigsty13.4 KiBpgcalendar_15-1.1.0-1PGSTY.el9.noarch.rpm
pgcalendar_151.1.0el10.x86_64pigsty13.5 KiBpgcalendar_15-1.1.0-1PGSTY.el10.noarch.rpm
pgcalendar_151.1.0el10.aarch64pigsty13.5 KiBpgcalendar_15-1.1.0-1PGSTY.el10.noarch.rpm
postgresql-15-pgcalendar1.1.0d12.x86_64pigsty7.3 KiBpostgresql-15-pgcalendar_1.1.0-1PGSTY~bookworm_all.deb
postgresql-15-pgcalendar1.1.0d12.aarch64pigsty7.3 KiBpostgresql-15-pgcalendar_1.1.0-1PGSTY~bookworm_all.deb
postgresql-15-pgcalendar1.1.0d13.x86_64pigsty7.3 KiBpostgresql-15-pgcalendar_1.1.0-1PGSTY~trixie_all.deb
postgresql-15-pgcalendar1.1.0d13.aarch64pigsty7.3 KiBpostgresql-15-pgcalendar_1.1.0-1PGSTY~trixie_all.deb
postgresql-15-pgcalendar1.1.0u22.x86_64pigsty7.4 KiBpostgresql-15-pgcalendar_1.1.0-1PGSTY~jammy_all.deb
postgresql-15-pgcalendar1.1.0u22.aarch64pigsty7.4 KiBpostgresql-15-pgcalendar_1.1.0-1PGSTY~jammy_all.deb
postgresql-15-pgcalendar1.1.0u24.x86_64pigsty7.4 KiBpostgresql-15-pgcalendar_1.1.0-1PGSTY~noble_all.deb
postgresql-15-pgcalendar1.1.0u24.aarch64pigsty7.4 KiBpostgresql-15-pgcalendar_1.1.0-1PGSTY~noble_all.deb
postgresql-15-pgcalendar1.1.0u26.x86_64pigsty7.4 KiBpostgresql-15-pgcalendar_1.1.0-1PGSTY~resolute_all.deb
postgresql-15-pgcalendar1.1.0u26.aarch64pigsty7.4 KiBpostgresql-15-pgcalendar_1.1.0-1PGSTY~resolute_all.deb

Source

pig build pkg pgcalendar;		# build rpm/deb

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 pgcalendar;		# install by package name

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

Create this extension with:

CREATE EXTENSION pgcalendar;

Usage

Sources: README, repo

pgcalendar is a recurring calendar extension for PostgreSQL. The upstream README models recurring schedules with four main pieces: events, schedules, exceptions, and generated projections.

Create events and schedules

CREATE EXTENSION pgcalendar;

INSERT INTO pgcalendar.events (name, description, category)
VALUES ('Daily Standup', 'Team daily standup meeting', 'meeting');

INSERT INTO pgcalendar.schedules (
    event_id, start_date, end_date, recurrence_type, recurrence_interval
) VALUES (
    1, '2024-01-01 09:00:00', '2024-01-07 23:59:59', 'daily', 1
);

The README shows daily, weekly, monthly, and yearly recurrences, with extra columns such as recurrence_day_of_week, recurrence_day_of_month, and recurrence_month depending on the recurrence type.

Query projections

SELECT * FROM pgcalendar.get_event_projections(
    1, '2024-01-01'::date, '2024-01-07'::date
);

SELECT * FROM pgcalendar.get_events_detailed(
    '2024-01-01'::date, '2024-01-31'::date
);

The README also uses the pgcalendar.event_calendar view as a quick verification target.

Exceptions and schedule transitions

INSERT INTO pgcalendar.exceptions (
    schedule_id, exception_date, exception_type, notes
) VALUES (
    1, '2024-01-15', 'cancelled', 'Holiday - meeting cancelled'
);

SELECT pgcalendar.transition_event_schedule(
    p_event_id := 1,
    p_new_start_date := '2024-01-15 09:00:00',
    p_new_end_date := '2024-01-31 23:59:59',
    p_recurrence_type := 'weekly',
    p_recurrence_interval := 2,
    p_recurrence_day_of_week := 1,
    p_description := 'Changed to bi-weekly schedule'
);

Use pgcalendar.check_schedule_overlap(...) before adding a new schedule when you need to verify that date ranges do not overlap.

Caveat

The upstream README is the only user-facing documentation currently published. It gives clear table and function examples, but it does not add separate versioned release notes for user-visible SQL changes.

Table reader