Skip to content
PostgreSQL Official News·· 14h ago

pg_kpart 2.0 Released

pg_kpart version 2.0 released

Key Takeaway

HexaCluster announced pg_kpart 2.0, adding PG19 support and a setting to block partition creation during configured time windows. A second setting, pg_kpart.nouser_change, prevents non-superuser roles from modifying extension settings when enabled.

Why It Matters

To avoid taking locks on busy partitioned tables when creating partitions during peak hours, explicitly configure the blocked time windows; by default, partition creation is unrestricted.

Technical Breakdown · Distilled from the original source

Query safeguards and compatibility

  • pg_kpart rejects queries that would scan every partition of a partitioned table without a usable predicate on the partition key. This guards against accidental scans of the entire partition hierarchy when a WHERE or JOIN condition on the partition key is missing.
  • Version 2.0 adds PG19 support. The extension runs on Linux and is available under the PostgreSQL license.

Partition creation windows and settings permissions

  • pg_kpart.deny_partition_creation takes a comma-separated list of HH:MM[:SS]-HH:MM[:SS] windows, such as '08:00-12:00, 14:00-18:00'. Each window includes its start and excludes its end. The default is empty, leaving partition creation unrestricted.
  • A window can cross midnight, as in '22:00-06:00', and 24:00 is accepted as an end time. A check hook rejects invalid values.
  • pg_kpart.nouser_change defaults to off. Setting it to on prevents non-superuser roles from modifying pg_kpart settings.
Source: PostgreSQL Official News· postgresql.org

PG Radar summarizes verified changes and impact. Read the original post for full technical details and code samples.

Read Official Source

Related PostgreSQL Reference