cranges
cranges · Closed forms of PostgreSQL discrete built-in ranges
Overview
Usage
Sources:
cranges adds closed-form variants of PostgreSQL’s three built-in discrete range types: cdaterange, cint4range, and cint8range. Their canonical representation includes both endpoints, unlike the built-in half-open [) representation.
The types otherwise reuse PostgreSQL range behavior, including operators and indexing support. The two-argument constructor remains hard-wired by PostgreSQL to assume [), so cint4range(1,5) is canonicalized to [1,4]. Upstream recommends the explicit three-argument constructor or literal syntax to avoid this surprise.
The project has no current release or PostgreSQL compatibility matrix and is hosted on Bitbucket rather than GitHub. Test casts, operators, indexes, dumps, and upgrades on the target PostgreSQL major before adopting the types in persistent schemas.