Postgres by Example
PostgreSQL is a powerful, open-source relational database. Please read the official documentation to learn more.
Postgres by Example is a hands-on introduction to PostgreSQL using annotated SQL examples. Check out the first example or browse the full list below.
Prerequisites: PostgreSQL installed and the server running. Examples assume you can connect with psql ; the default database is postgres unless noted. Start the server with your system's service manager or pg_ctl start as needed.
Unless stated otherwise, examples target current stable PostgreSQL. Use the latest version you can if something isn't working.
Table of Contents
Getting Started
Querying
Data Types
DDL
... continue reading