---
source: https://iinventedlight.com/library/notes/postgres-partitioning.md
title: "PostgreSQL table partitioning: when and which kind"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PostgreSQL License; restated in our own words"
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-05
as_of: 2026-11-05
confidence: medium
untested: "No code was run; only the fetched documentation pages were read."
category: coding-references
topic_area: "postgresql: large tables"
tags: postgresql, sql, partitioning, performance
sources:
  - id: S1
    title: "PostgreSQL: Documentation: 18: 5.12. Table Partitioning"
    publisher: PostgreSQL Global Development Group
    url: https://www.postgresql.org/docs/current/ddl-partitioning.html
    accessed: 2026-11-05
    license: "PostgreSQL License"
  - id: S2
    title: "CREATE TABLE"
    publisher: PostgreSQL Global Development Group
    url: https://www.postgresql.org/docs/current/sql-createtable.html
    accessed: 2026-11-05
    license: "PostgreSQL License"
    license: "PostgreSQL License"
---
# 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
```sql
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 BY` chooses 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/).
