pgchronos
pgchronos · SQL functions and operators for union, intersection, and difference over daterange and tstzrange arrays.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100063 | pgchronos | pgchronos | 1.0.2 | TIME | BSD-3-Clause | SQL |
PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18
Usage
Sources:
pgchronos is a pure-SQL demonstration of set operations over arrays of daterange and tstzrange. It supplies union, intersection, difference, reduction, and containment functions and corresponding +, *, -, <@, and @> operators.
The result is an array of non-overlapping remaining ranges. Union and reduce combine overlapping or adjacent ranges, while intersection retains common segments. Confirm boundary inclusivity, empty and infinite bounds, nulls, ordering, duplicates, daylight-saving behavior, and normalization for the exact range subtype.
Upstream explicitly corrects an earlier “stable” label: the entire 1.x line is an alpha-quality conceptual demonstration and is not suitable for production. The repository is abandoned. Prefer maintained multirange features in supported PostgreSQL releases or thoroughly reviewed application SQL. If preserving old data, create property-based tests for algebraic identities and migrate operator-dependent expressions carefully because custom operators can change query meaning globally.