PostgreSQL tutorials
PostgreSQL Tutorials: Learn PostgreSQL Step by Step
Every PostgreSQL tutorial on DatabaseFAQs.com, grouped by topic. Install it, connect with psql or pgAdmin, then learn tables, queries, dates and PL/pgSQL.
Our newer and rewritten examples are tested on PostgreSQL 18.
- 105free PostgreSQL tutorials
- 15topics
- Oct 2026last updated
New to PostgreSQL? Start here
Read these in order. Each one builds on the one before it.
- How to Download and Install PostgreSQL on WindowsInstall PostgreSQL and pgAdmin on Windows.
- How to Connect to a PostgreSQL Database (psql, pgAdmin, Linux, Python)Connect with psql, pgAdmin or code.
- How to Create Database in PostgreSQLCreate your first database.
- How to create a table in PostgreSQLCreate a table with the right data types.
- PostgreSQL SELECTRead and filter your data.
- PostgreSQL JoinsCombine data from related tables.
The basics6
What it is, what it's good for, and the questions people ask before they commit to it.
Install, connect and tools8
Install it, connect to it, and get your tools working.
- How To Check PostgreSQL Version
- How to Restart PostgreSQL (Linux, Windows, Mac)
- How to Uninstall PostgreSQL (Linux, Mac,Windows)
- PostgreSQL installation on Linux step by step
- PostgreSQL Latest Version
- Postgresql listen_addresses
- How to Connect to a PostgreSQL Database (psql, pgAdmin, Linux, Python)
- How to Download and Install PostgreSQL on Windows
Databases, tables and columns18
Create and change databases, tables, columns, keys, indexes and views.
- Drop Database PSQL
- How To Create An Index In PostgreSQL
- How to Create View in PostgreSQL
- How to Drop All Tables in PostgreSQL
- How to find primary column name in Postgresql
- How to Rename Column in PostgreSQL
- PostgreSQL ADD COLUMN
- PostgreSQL Add Foreign Key If Not Exists
- PostgreSQL add primary key
- PostgreSQL ALTER TABLE
- PostgreSQL CASE Multiple Columns
- PostgreSQL DROP COLUMN
- PostgreSQL DROP TABLE
- PostgreSQL List Databases
- PostgreSQL Schema
- PostgreSQL Unique Constraint
- How to create a table in PostgreSQL
- How to Create Database in PostgreSQL
Data types6
Pick the right data type for every column.
SELECT queries, filtering and grouping10
Read data with SELECT, filter it, sort it and summarize it.
Joins2
Combine rows from two or more tables.
Insert, update and delete5
Add, change and remove rows safely.
Strings, numbers and conversions9
Work with text and numbers, and convert between types.
Dates and times13
Format, compare and calculate dates and times.
- How to find date difference in PostgreSQL
- Postgres date range
- Postgres Timestamp Comparison
- PostgreSQL Cast Timestamp To Date
- PostgreSQL current_timestamp
- PostgreSQL Date Add
- PostgreSQL date between two dates
- PostgreSQL Date Part Hour
- PostgreSQL date string to timestamp
- PostgreSQL date to string
- PostgreSQL ORDER BY: DESC LIMIT 1, Dates, NULLs and Custom Order
- PostgreSQL To_Char Date Format
- PostgreSQL TO_TIMESTAMP
Functions7
Built-in functions and the ones you write yourself.
Stored procedures, variables and control flow5
Stored procedures, variables, IF/CASE logic, loops, error handling and transactions.
Users, logins and permissions3
Create users, reset passwords and grant the right permissions.
Backup, import/export and administration5
Back up, restore, import, export, migrate and monitor.
Errors and fixes3
The exact error message, what causes it and the steps that fix it.
Comparisons5
Side-by-side comparisons to help you choose.
Other database tutorials
Looking for everything, newest first? See the full tutorial list.
Frequently Asked Questions
Is PostgreSQL free?
Yes. PostgreSQL is open source and free to use for any purpose, including commercial production systems.
What’s the latest version of PostgreSQL?
PostgreSQL 18 is the newest major version (18.6 is the current minor release). Each major version is supported for five years after its first release.
Where should a beginner start?
Use the six-step path at the top of this page: install PostgreSQL, connect to it, create a database and a table, then learn SELECT and joins.
Should I use psql or pgAdmin?
Both are installed with PostgreSQL on Windows. pgAdmin is easier when you’re starting out; psql is faster once you know the commands and works over SSH on Linux servers.