partition

Range partitioning

Divide rows by ordered intervals. Lower limits are included and upper limits excluded; nonoverlapping bounds are required.

Formal Syntax & Structure

sql syntaxsql
PARTITION BY RANGE (key)

Working Example

Example Snippetsql
-- Run independently in a fresh disposable PostgreSQL database/schema.CREATE TABLE events(d date) PARTITION BY RANGE(d);CREATE TABLE events_jan PARTITION OF events FOR VALUES FROM ('2025-01-01') TO ('2025-02-01');
SQL Reference