Start using PostgreSQL

What PostgreSQL is

Understand the PostgreSQL client-server model and the PostgreSQL 18 baseline used throughout this course.

PostgreSQL is a relational database server. It stores related data in tables, and you work with that data through SQL.

The word server matters. PostgreSQL is not a file your application opens, the way SQLite is. It is a long-running process. The server owns the data files, manages concurrent work, and listens for connections from applications and tools.

That design is what makes PostgreSQL safe under load. Twenty application processes can read and write at the same time, and the server coordinates them. It enforces constraints, isolates transactions, and recovers cleanly after a crash.

Three things people mix up

When you start, three names blur together. Keep them separate:

  • PostgreSQL is the server. It runs in the background and does the actual work.
  • SQL is the language you send to PostgreSQL. SELECT, INSERT, CREATE TABLE are SQL.
  • psql is one command-line client that sends SQL to the server. It is not the server. It is one program that talks to it.

Your Node.js application is another client. A GUI like TablePlus is a third. They all speak the same protocol to the same server.

One server, several databases

One server can hold several databases. A connection enters one database as one role, then works with tables and other objects inside that database.

You can see this from any client:

SELECT current_database(), current_user;
 current_database | current_user
------------------+--------------
 postgres         | flavio

Every statement you run happens in that context: this database, this role.

The version baseline

This course targets PostgreSQL 18. PostgreSQL ships a new major version about once a year and supports each one for five years.

Check what a server actually runs before trusting a tutorial written for an older release:

SELECT version();
 PostgreSQL 18.1 on aarch64-apple-darwin24.4.0, compiled by ...

A common early confusion: psql --version in your terminal reports the client version, not the server. The two can differ, for example when your laptop’s psql connects to a hosted database. SELECT version(); asks the server itself, so trust that one.

Lesson completed

Take this course offline

Get every free book, course edition, and software download.

Get the download library →