range_partitioning
range_partitioning · Manages trigger-based static range partitions for PostgreSQL-XL, including split and merge operations.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100314 | range_partitioning | range_partitioning | 1.2.2 | OLAP | PostgreSQL | SQL |
| Relationships | |
|---|---|
| Requires | plpgsql |
Usage
Sources:
range_partitioning implements trigger-based table partitioning with PostgreSQL range types. It converts an ordinary table into a managed parent, routes inserted rows to child tables, and can split or merge adjacent ranges. It predates PostgreSQL’s declarative partitioning and should be treated as a legacy alternative, not mixed casually with native PARTITION BY tables.
Core Workflow
Install the relocatable extension in a dedicated schema, grant its management role only to partition administrators, and convert an existing table by naming its partition key:
create_parent creates metadata, an initial unbounded child, constraints, and the insert-routing trigger. If more than one compatible range type exists, pass the qualified range type explicitly. create_partition requires the new range to be a complete subset of one existing partition and splits that partition.
Management and Inspection
drop_partitionmerges a child into a named adjacent partition; it is not simply a detach operation.masterandpartitionhold management metadata, whilemaster_partitionexposes a joined reporting view.get_destination_partitionidentifies which child would receive a candidate key.where_clausederives a predicate for a range or an existing partition.value_in_range,is_subrange,range_add,range_subtract, andconstructor_clausemanipulate dynamically specified range values.
Inspect the managed layout before and after every split or merge:
Privileges and Caveats
The upstream README says installation creates a role named range_partitioning; grant that role only to users who must create or remove partitions. Child creation carries table structure and permissions according to the extension’s legacy implementation, so verify indexes, grants, triggers, ownership, and dump/restore behavior on representative tables.
Version 1.2.2 requires PostgreSQL 9.2 or later and was released in 2016. The control file declares no preload requirement or extension dependency. Modern PostgreSQL offers declarative range partitioning with planner and maintenance integration; compare it before adopting this trigger-and-metadata design. Partition changes move or rewrite data and acquire locks, so size and rehearse them. Use the extension’s upgrade scripts with ALTER EXTENSION, and do not manually edit its metadata tables.