partman_to_cstore
partman_to_cstore · Move old pg_partman partitions to cstore columnar storage.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100356 | partman_to_cstore | partman_to_cstore | 1.1.0 | OLAP | PostgreSQL | SQL |
PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18
| Relationships | |
|---|---|
| Requires | cstore_fdw pg_partman plpgsql |
Usage
Sources:
partman_to_cstore is an experimental archival bridge for old pg_partman time-based partitions. It copies a heap partition into a cstore_fdw foreign table, reproduces inheritance, check constraints, ownership, and grants, then drops the original heap. It can later drop aged cstore partitions according to a second interval.
Core Workflow
Install the two declared dependencies and place the non-relocatable extension in a dedicated schema:
Run the function from a controlled scheduler only after verifying the candidate partitions. move_singlepart_to_cstore(part_schema, part_table, ...) performs the same destructive conversion for one inherited partition.
Object Index
move_configstores each parent, migration age, retention age, compression, stripe/block sizing, and last-check time.part_to_cstore(...)discovers eligiblepg_partmanchildren, creates cstore foreign tables, copies data, and removes the heap tables.move_singlepart_to_cstore(...)converts one inherited child.partman_to_cstore_serveris thecstore_fdwforeign server created by the extension.partman_to_cstore_move_datais the supplied cron-oriented Python driver.
Operational Notes
Version 1.1.0 requires pg_partman and cstore_fdw, is non-relocatable, and declares no preload requirement. Upstream documents support only time-based pg_partman partitions, including epoch-based naming. The SQL assumes old pg_partman catalog and function shapes, while the scheduler script uses Python 2 syntax; test compatibility before using it with current releases.
The conversion copies rows and then issues DROP TABLE for the original heap. The upstream warning states that pg_dump captures cstore foreign-table schema but not its data. Prove row counts, constraints, grants, query behavior, physical backups, and restore before scheduling migration; retain an independently restorable copy of archived data.