PostgreSQL Partition Manager (pg_partman) 4.2.0 Released

Posted on 2019-08-23 by Crunchy Data
Related Open Source

Crunchy Data is pleased to announce the release of pg_partman 4.2.0, the latest version of the open source partition management PostgreSQL extension.

pg_partman 4.2 adds preliminary support for PostgreSQL 12 and introduces an important change to how UNLOGGED tables are managed in a partition set.

pg_partman is a PostgreSQL extension that helps you to manage both time series and serial-based table partition sets, including automatic management of partition creation and runtime maintenance. pg_partman works with the native partitioning introduced into PostgreSQL 10 so users can benefit from significant performance enhancements.

You can follow the instructions in the README to install pg_partman or use a preferred package manager of your choice.

Notable Changes

  • pg_partman has added preliminary support for PostgreSQL 12, and will be dropping support for PostgreSQL 9.4 after PostgreSQL 12 is released.

  • As of PostgreSQL 12, pg_partman will no longer support inheriting OIDs as this special column behavior has been removed.

  • The UNLOGGED status of a partition set in native partitioning is now managed by the template table instead of the parent table.

Currently in PostgreSQL, setting a natively partitioned parent table as UNLOGGED/LOGGED is not a property that can be changed with an ALTER TABLE. If the state of UNLOGGED/LOGGED is subsequently changed on the parent table, it will not be passed on to new child tables.

If you believe you have child tables affected by this, you will have to fix them manually. If any of your native partition sets are UNLOGGED, be sure to set this property on the template table before upgrading to this version.

pg_partman will maintain this behavior until PostgreSQL determines a definitive way that UNLOGGED changes will be handled. For more information, please see:

  • Changed default option for the maintenance background worker running ANALYZE on child table creation to false for PostgreSQL 11 and later versions. If this is desired, please set the option pg_partman_bgw.analyze to true in your postgresql.conf.


  • Added new configuration option constraint_valid to the part_config(_sub) table to control whether the additional constraints that pg_partman can manage are added in a NOT VALID state. By default, the constraints are added as VALID as they were before. Note that if this config is changed to false, constraint exclusion will not work until the constraints are validated.


  • Fixed bug that prevented pg_partman from creating child tables in PostgreSQL 12 due to usage of pg_class.relhasoids column
  • Fixed bug where primary key/unique indexes applied to pre-existing template tables were not being applied to the default partition that was added in PostgreSQL 11 native partitioning.
  • Fixed bug that caused an error in the retention management of time-based partitioning sets. If retention would attempt to remove the last child table, maintenance would throw an error about a missing table instead of just a warning about the last table attempting to be dropped.
  • Properly throw an error with create_parent() when the data type of the partition column is numeric. Previously, it would not report any errors but would also not add the proper data to the part_config table so future maintenance would not work.


Crunchy Data is proud to support the development and maintenance of pg_partman.