public inbox for [email protected]
help / color / mirror / Atom feedFrom: HexaCluster via PostgreSQL Announce <[email protected]>
To: PostgreSQL Announce <[email protected]>
Subject: pg_kpart version 1.0
Date: Tue, 16 Jun 2026 14:35:58 +0000
Message-ID: <[email protected]> (raw)
Bangkok, Thailand - June 12, 2026
## pg_kpart - Reject queries that scan all partitions without using the partition key
`pg_kpart` is a PostgreSQL extension that rejects queries which would scan every partition of a partitioned table without a usable predicate on the partition key. It prevents accidental full-hierarchy scans caused by missing WHERE/JOIN conditions on the partition key.
As a DBA, you have almost certainly run into queries that hit a partitioned table without using the partition key. On tables holding hundreds of millions or billions of rows, it is a disaster: PostgreSQL has no choice but to scan every partition, the server's I/O subsystem saturates, and overall performance collapses for everyone connected to the instance.
The rule it enforces is simple: if a query against a protected partitioned table cannot prune *any* partitions, it is not allowed to run. The author gets a clear error instead of a server-wide I/O storm, and the query has to be rewritten to filter on the partition key — which is exactly the access pattern partitioning is meant to encourage.
`pg_kpart` turns "please always filter on the partition key" from a fragile convention that depends on every developer remembering it into a guarantee enforced by the database itself. With an audit mode to ease the rollout, blacklist/whitelist scoping to target exactly the tables that matter, and a dedicated SQLSTATE so applications can react to violations cleanly, it slots neatly into a production workflow. If you run large partitioned tables and you would rather not be at the mercy of the next query that forgets the partition key, this extension is for you.
See this blog post for more information: [https://hexacluster.ai/blog/pg-kpart-postgresql-extension](https://hexacluster.ai/blog/pg-kpart-postgresql-extension)
## Links & Credits
pg_kpart is an open project. Any contribution to build a better
tool is welcome. You just have to send your ideas, features requests
or patches using the GitHub tools.
Thank to the developers who submitted patches and users who reported
bugs and feature requests, they are all cited in the ChangeLog file.
Links:
* Documentation: [https://github.com/HexaCluster/pg_kpart/blob/main/README.md](https://github.com/HexaCluster/pg_kpart/blob/main/README.md)
* Download: [https://github.com/hexacluster/pg_kpart/releases](https://github.com/hexacluster/pg_kpart/releases)
* Development: [https://github.com/hexacluster/pg_kpart](https://github.com/hexacluster/pg_kpart)
* Changelog: [https://github.com/hexacluster/pg_kpart/blob/master/ChangeLog]([https://github.com/hexacluster/pg_kpart/blob/master/ChangeLog)
-----------------
**About pg_kpart**
The objective of pg_kpart is to have a tool to help PostgreSQL
DBAs to enforce the correct use of PostgreSQL partitioning.
Tool created at HexaCluster Corp and maintained by Gilles Darold.
pg_kpart works on Linux platform and is available under the PostgreSQL license.
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pg_kpart version 1.0
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox