PostgreSQL table partitioning
Short answer
Partitioning splits one logical table into smaller physical pieces. Queries can skip irrelevant partitions; bulk load and delete can add or drop whole partitions. [S1]
Sketch
CREATE TABLE measurement (
logdate date not null, peaktemp int
) PARTITION BY RANGE (logdate);
Points
- Partitioning is splitting one large logical table into smaller pieces. [S1]
- Bulk loads and deletes can add or remove partitions. [S1]
CREATE TABLE ... PARTITION BYchooses the strategy and partition key. [S2]- The parenthesized key list is the partition key for the table. [S2]
Claims
- id: C1 claim: Partitioning splits one logical table into smaller pieces. source: S1 evidence: "splitting what is logically one large table into smaller physical pieces"
- id: C2 claim: Bulk loads and deletes can add or remove partitions. source: S1 evidence: "Bulk loads and deletes can be accomplished by adding or removing partitions"
- id: C3 claim: PARTITION BY sets the partitioning strategy. source: S2 evidence: "The optional PARTITION BY clause specifies a strategy of partitioning the table"
- id: C4 claim: The column list forms the partition key. source: S2 evidence: "forms the partition key for the table"
Sources
- [S1] PostgreSQL: Documentation: 18: 5.12. Table Partitioning. PostgreSQL Global Development Group. https://www.postgresql.org/docs/current/ddl-partitioning.html . License: PostgreSQL License. Accessed 2026-11-05.
- [S2] CREATE TABLE. PostgreSQL Global Development Group. https://www.postgresql.org/docs/current/sql-createtable.html . License: PostgreSQL License. Accessed 2026-11-05.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
Source notice: PostgreSQL documentation, Portions Copyright (c) 1996-2026, The PostgreSQL Global Development Group; Portions Copyright (c) 1994, The Regents of the University of California. Used under the PostgreSQL License (https://www.postgresql.org/about/licence/).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: PostgreSQL Global Development Group, PostgreSQL: Documentation: 18: 5.12. Table Partitioning, PostgreSQL License; PostgreSQL Global Development Group, CREATE TABLE, PostgreSQL License.
Cite this
iinventedlight. 2026. "PostgreSQL table partitioning: when and which kind." iinventedlight Library, iil:note:shrgk9e7, version of 2026-11-04. https://iinventedlight.com/library/notes/postgres-partitioning/. License: CC-BY-4.0.
@misc{iil_note_shrgk9e7,
author = {{iinventedlight}},
title = {{PostgreSQL table partitioning: when and which kind}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/postgres-partitioning/},
note = {Permanent ID iil:note:shrgk9e7. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/postgres-partitioning.md.