pg-partman-partitioning

Automate declarative partitioning for large PostgreSQL tables with pg_partman.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/Mercurium-Analytics/pg-search-vector --skill pg-partman-partitioning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pg-partman-partitioning
Source: https://github.com/Mercurium-Analytics/pg-search-vector/tree/main/skills/pg-partman-partitioning
Command: npx skills add https://github.com/Mercurium-Analytics/pg-search-vector --skill pg-partman-partitioning

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Partitioning large PostgreSQL tables is operationally challenging due to manual partition management, maintenance windows, and fragmented queries. pg_partman automates the lifecycle of partitions, enabling scalable and maintainable data organization.

Core Features & Use Cases

  • Automates creation of future partitions for time-based and list-based tables.
  • Manages lifecycle, retention, and maintenance routines using partman.
  • Supports migration of existing non-partitioned tables to partitioned structures with minimal downtime.

Quick Start

Install the pg_partman extension, create a parent table partitioned by a chosen column, and run the partman.create_parent procedure to initialize partitions.

Frequently Asked Questions about pg-partman-partitioning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate PostgreSQL partitioning for large tables?

Automate PostgreSQL partitioning for large tables by using pg_partman to apply declarative partitioning, which handles automatic creation of future partitions and lifecycle maintenance tasks for time-based and list-based scenarios.

Can I migrate an existing non-partitioned PostgreSQL table to a partitioned structure?

Yes, you can migrate existing non-partitioned PostgreSQL tables to partitioned structures with minimal downtime using pg_partman, which manages the transition while preserving data integrity.

Does pg_partman support both time-based and list-based partitioning?

Yes, pg_partman supports both time-based and list-based partitioning scenarios, allowing you to automatically create future partitions and manage maintenance routines for large PostgreSQL tables.

What primary key rules are required for PostgreSQL partitioning with pg_partman?

PostgreSQL partitioning with pg_partman requires primary key rules that include the partition column, ensuring data integrity across automatically created time-based or list-based partitions.

How do I initialize partitions using pg_partman in PostgreSQL?

Initialize partitions in PostgreSQL by installing the pg_partman extension, creating a parent table partitioned by your chosen column, and running the partman.create_parent procedure to automate future partition creation.