partition
Partition keys
Choose keys according to filtering and retention needs. A parent primary key or unique constraint must include all partition key columns; expression partition keys preclude such constraints.
Formal Syntax & Structure
sql syntaxsql
PARTITION BY RANGE (key)Working Example
Example Snippetsql
-- Run independently in a fresh disposable PostgreSQL database/schema.CREATE TABLE sales(d date,id int,PRIMARY KEY(d,id)) PARTITION BY RANGE(d);