pgchronos 1.0 released - Mailing list pgsql-announce

From Eric Worden
Subject pgchronos 1.0 released
Date
Msg-id CAN5pzZhdWvHq_cNjM3qd9HY58drkGk4pWxR5TZ8N4DeQJxgSuA@mail.gmail.com
Whole thread Raw
List pgsql-announce
PGCHRONOS 1.0 RELEASED
======================

pgchronos is a new Postgresql extension providing sql functions and operators for performing union, intersection, and difference operations on sets of daterange and tstzrange types.

As a simple example of a difference operation, imagine a hotel where frequent customers can earn special member rates during most of the year, excluding holiday weeks.

    Select unnest(
        (select array_agg(range) from special_membership_ranges) -
        (select array_agg(range) from holiday_exclusion_ranges)) special_booking_ranges;

    special_booking_ranges
    -------------------------
    [2015-01-02,2015-01-06)
    [2015-01-07,2015-01-21)
    [2015-01-22,2015-01-29)

More typical usage scenarios will be more complex, something like subtracting student sick date ranges from the same students' course enrollment date ranges to find exact student attendance date ranges for some set of students.

These functions were originally developed as part of the ChronosDB project.  That code became half-obsolete when Postgres introduced range data types in version 9.2. This code is a reimplementation that brings it current with the latest Postgres versions, and utilizes the native Postgres range data types.  The current project site is <https://github.com/worden341/pgchronos>.


REQUIREMENTS
============

pgchronos utilizes the range datatypes introduced in Postgresql 9.2, therefore that is the minimum version you can use with this extension.


LINKS
=====


Eric Worden

pgsql-announce by date:

Previous
From: David Fetter
Date:
Subject: == PostgreSQL Weekly News - November 01 2015 ==
Next
From: David Fetter
Date:
Subject: == PostgreSQL Weekly News - November 08 2015 ==