Postgres by Example

Hacker News Top Tools

Summary

A hands-on introduction to PostgreSQL using annotated SQL examples, covering basics to advanced topics.

No content available
Original Article
View Cached Full Text

Cached at: 06/10/26, 05:45 PM

boringcollege/postgres-by-example

Source: https://github.com/boringcollege/postgres-by-example

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

DML

Joins and Sets

Aggregation and Grouping

Subqueries

Functions and Operators

Indexes

Transactions

Views

Security

Extras


Licensed under CC BY 4.0.

by Dariush Abbasi | source

Similar Articles

PostgreSQL 19 Interactive Tour

Hacker News Top

This article provides an interactive guide to new features in PostgreSQL 19 beta, focusing on SQL/PGQ for property graph queries with hands-on examples.

The startup's Postgres survival guide

Hacker News Top

A comprehensive guide for startups running PostgreSQL in production, covering schema design, query optimization, indexes, migrations, connection management, and advanced topics like query planning and partitioning.

PostgreSQL for Everything

Hacker News Top

This article argues that PostgreSQL is a versatile database solution capable of replacing multiple specialized technologies such as search engines, message queues, and caches, thereby simplifying IT setups.