PostgreSQL Documentation
The official PostgreSQL manual for the current release: a tutorial, the full SQL language reference, every data type and function, server administration, and chapters on indexes, EXPLAIN and concurrency control. It is accurate, well written and the place to check any PostgreSQL behaviour before trusting a blog post.
Guide
Web Development
PostgreSQL Global Development Group
All
Free
What it is
The PostgreSQL documentation is the official manual maintained by the PostgreSQL Global Development Group. The /docs/current/ address always points at the latest major release; older versions have their own pages. It is organised in parts: a short tutorial, the SQL language (syntax, queries, data definition, data manipulation, data types, functions and operators, indexes, concurrency control, performance tips), server administration (installation, configuration, roles, backup and restore, replication, monitoring), client interfaces, and a complete reference of every SQL command and client application such as psql and pg_dump.
Is it worth your time?
Yes. PostgreSQL's manual is widely regarded as one of the best in open source software: precise, complete and readable. As a learner you will not read it cover to cover, but you should learn to use it, because it answers questions that tutorials skip, such as exactly how NULLs sort, what each isolation level allows or what an EXPLAIN node means.
Where to start
- The tutorial (Part I) if you are new: it walks through creating a database, tables, queries, joins, aggregates, views, foreign keys, transactions and window functions.
- Chapter 7, Queries, for joins, set operations, CTEs and window functions.
- Chapter 8, Data Types, and Chapter 9, Functions and Operators, as everyday references.
- Chapter 13, Concurrency Control, for isolation levels and locking.
- Chapter 14, Performance Tips, especially Using EXPLAIN.
- The SQL Commands reference for exact syntax, such as INSERT ... ON CONFLICT.
Chapter numbers can shift between releases, so use the table of contents if a number does not match.
Free vs paid
Completely free, online and as downloadable PDFs for each release.
How to use it well
- Check which version the page is for; the version switcher at the top shows differences between releases.
- When a tutorial shows a trick, look up the command page to see the options and caveats it left out.
- Read the "Notes" and "Compatibility" sections at the bottom of command pages: they say how PostgreSQL differs from the SQL standard and other databases.
Common questions
Is it too advanced for beginners? The tutorial is written for beginners. The reference parts assume you know what you are looking for, which comes with practice.
Which version should I read? The version you have installed. Run SELECT version(); to check.
Ready to start?
Opens on PostgreSQL Global Development Group in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.