Skip to content

Instantly share code, notes, and snippets.

View gingermike's full-sized avatar

Mike Lewis gingermike

View GitHub Profile

Bitemporal Closure Table with PostgreSQL ltree

This repository demonstrates an advanced PostgreSQL schema for managing hierarchical data with bitemporal tracking (both business time and system time) using a closure table pattern and PostgreSQL's ltree extension.

Overview

Key Concepts

Bitemporality: Tracks two independent time dimensions:

  • Effective Time (effective_range): When something was true in the real world (business time)