Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PostgreSQL Style Guide

Apply the loaded policy pages directly.

Routing

Workflows

TaskLoad
Change a live database schemasafe migration workflow
Stand up a new databasedatabase setup workflow
Investigate a slow queryperformance workflow
Review schema, migration, or query changesreview workflow

Policy Fast Paths

TaskLoad
Design a new tableobject naming, primary keys, foreign keys, scalar types, constraints, standard columns
Choose a primary key or ID typeprimary keys and row identity
Model a status or categoryenums/domains/lookups, constraints
Choose columns, JSONB, or arraysJSONB and normalization, advanced indexes
Write a multi-step or reporting queryCTEs, join style, aggregation and pagination
Write an upsert or bulk writeDML and upserts
Add an indexindex basics, plus advanced indexes for partial, expression, multicolumn, covering, GIN, JSONB, array, or range indexes
Add a database functionfunctions and procedures
Add a triggertriggers
Add a view or materialized viewviews and materialized views
Configure roles, grants, or RLSroles, privileges, and RLS
Other PostgreSQL policy workguideline index

Core Behavior

  • Workflows own multi-step procedures and route to their policy pages.
  • Fast paths load only the directly linked owner pages.
  • Use the guideline index only when no workflow or fast path matches.
  • Select conditional pages using task descriptions in this router, the guideline index, or workflow routing.
  • After loading a conditional page, apply it only when its Activation section matches.
  • Treat live-database migrations as stricter than greenfield DDL.
  • Prefer concrete PostgreSQL guidance over SQL tutorials.
  • Ask one focused question only when required project context is missing.