pg_partman

1. Overview

pg_partman is a PostgreSQL extension for managing partitioned tables and indexes. It automates the creation and maintenance of time-based and serial-based partitions. It is fully compatible with IvorySQL.

2. Installation

2.1. Prerequisites

Automatic background maintenance requires the pg_partman_bgw background worker. Add it to shared_preload_libraries in postgresql.conf:

shared_preload_libraries = 'pg_partman_bgw'

2.2. Source Code Installation

Please ensure that IvorySQL 5.4 or above is installed and pg_config is available in PATH.
$ git clone https://github.com/pgpartman/pg_partman.git
$ cd pg_partman
$ make
$ sudo make install

3. Create Extension and Verify

Connect to the database with psql and execute the following commands:

ivorysql=# CREATE EXTENSION pg_partman;
CREATE EXTENSION

ivorysql=# SELECT * FROM pg_available_extensions WHERE name = 'pg_partman';
    name    | default_version | installed_version |        comment
------------+-----------------+-------------------+-----------------------
 pg_partman | 5.2.4           | 5.2.4             | Extension to manage partitioned tables by time or ID

See the pg_partman documentation for usage and configuration.