PostgreSQL tutorial and production guide
A PostgreSQL 18 tutorial and operations reference for learners, engineering teams, and AI agents
This guide is not a replacement for the PostgreSQL manual. It is a map into it. The current baseline is PostgreSQL 18, while pages avoid version-specific behavior unless they label it explicitly.
PostgreSQL 19 topic
Beta 2 news, features, and a compatibility and rollback checklist for upgrading PostgreSQL 18 to 19.
New here? Start here
A progressive route from a running instance to reading query plans.
Install and connect
Ubuntu, macOS, Windows, Docker, psql, and SSL.
AI / agent reference
Compact schema contracts, safe SQL rules, retrieval, and error semantics.
Performance & EXPLAIN
Measure before indexing and verify every optimization with a plan.
Production operations
Recovery, security, replication, upgrades, and routine checks.
Two reading modes
Human learning mode
Follow Start here in order. Each page states the outcome, gives a minimal example, explains the model, verifies the result, and points to a next step. You do not need to memorize system catalogs or the full SQL grammar.
AI retrieval mode
Enter through the AI / agent index. Pages use stable headings, explicit preconditions, copyable SQL, boundaries, and failure modes. Retrieve the relevant section; do not inject the whole site into one prompt.
Documentation conventions
| Label | Meaning |
|---|---|
| Default | PostgreSQL default behavior; verify it on the target instance |
| Recommended | A strong default for new systems, not the only valid choice |
| Danger | May lock data, lose data, leak privilege, or create long transactions |
| Verify | A command or query that confirms the result |
Authoritative source
For normative detail, use the PostgreSQL 18 manual. This field guide contributes paths, examples, guardrails, and cross-topic connections.
Last updated on