psql is quick, but some things are easier to see than to type. pgAdmin 4 is PostgreSQL’s free graphical tool: a window where you browse your servers and databases in a tree, and type SQL in an editor that shows the results in a grid.
In this part you open pgAdmin, connect it to your PostgreSQL 19 server, find your way around its main window and run your first query in the Query Tool. By the end, pgAdmin is ready for every later part that uses it.
This is Part 3 of the PostgreSQL Tutorial. The parts in Module A, Start Here:
- Part 1: What Is PostgreSQL? Databases, Tables and SQL Explained
- Part 2: Connect with psql and Run Your First Commands
- Part 3: pgAdmin 4 for Beginners (you are here)
All parts of the PostgreSQL Tutorial
Module A: Start Here
- Part 1: What Is PostgreSQL? Databases, Tables and SQL Explained
- Part 2: Connect with psql and Run Your First Commands
- Part 3: pgAdmin 4 for Beginners
Module B: Build the Database
- Part 4: Create a Database
- Part 5: Data Types Explained
- Part 6: Create Tables
- Part 7: Primary Keys, Foreign Keys and Constraints
- Part 8: Insert, Update and Delete Data
- Part 9: Import and Export CSV Files
Module C: Query Data
- Part 10: SELECT, WHERE, ORDER BY and LIMIT
- Part 11: LIKE, IN, BETWEEN, NULL and CASE
- Part 12: GROUP BY and Aggregate Functions
- Part 13: JOINs Explained
- Part 14: Subqueries and CTEs
- Part 15: UNION, INTERSECT and EXCEPT
- Part 16: String, Number and Conversion Functions
- Part 17: Dates, Times and Time Zones
Module D: Design and Performance
- Part 18: Database Design and Normalization
- Part 19: Views and Materialized Views
- Part 20: Indexes Explained
- Part 21: EXPLAIN and Query Performance
- Part 22: Transactions, Isolation Levels and Locks
Module E: Advanced SQL and Programming
- Part 23: Window Functions
- Part 24: Recursive Queries and LATERAL Joins
- Part 25: JSON and JSONB
- Part 26: Arrays, Enums, Ranges and Generated Columns
- Part 27: Full-Text Search
- Part 28: Functions and Stored Procedures
- Part 29: Triggers
Module F: Administration and Security
- Part 30: Users, Roles and Privileges
- Part 31: Row-Level Security
- Part 32: Configuration and Restarting the Server
- Part 33: Allow Remote Connections Securely
- Part 34: Backup and Restore
- Part 35: Automate Backups
- Part 36: VACUUM, ANALYZE and Autovacuum
- Part 37: Monitoring and Slow Queries
- Part 38: Table Partitioning
- Part 39: Streaming Replication
- Part 40: Upgrade to a New Major Version
Module G: PostgreSQL for Developers
- Part 41: Connect from C# .NET with Npgsql
- Part 42: Entity Framework Core with PostgreSQL
- Part 43: Connect from Python with psycopg
- Part 44: Connect from Node.js with node-postgres
Module H: Extensions, AI and Cloud
- Part 45: Extensions
- Part 46: Vector Search with pgvector
- Part 47: Azure Database for PostgreSQL
- Part 48: Migrate to Azure and What to Learn Next
Every screen and output on this page is real, from pgAdmin 4 9.19 with PostgreSQL 19 on macOS.
Where the bookstore database is now: it doesn’t exist yet. Part 4 creates it, so there’s nothing to catch up on. In this part you only look around the server.
Prerequisites
- Part 2: Connect with psql and Run Your First Commands, so your server is running and you know the password of the
postgresuser. - pgAdmin 4, version 9.19 or later. The PostgreSQL installer for macOS offers to install it; otherwise, download it from the pgAdmin website (opens in a new tab).
Step 1: Open pgAdmin 4
Open pgAdmin 4 from your Applications folder. If you installed PostgreSQL as How to Install PostgreSQL 19 on macOS shows, it’s already there. The window opens on the Welcome page:

- Object Explorer, on the left: a tree of your servers and everything in them.
- Tabs, on the right: Dashboard, Properties, SQL and more, each showing something about whatever you select in the tree.
- Welcome: links to get started, such as Add New Server.
Step 2: Connect to Your Server
Click the arrow next to Servers. pgAdmin already lists PostgreSQL 19: it looks for PostgreSQL servers installed on your computer and adds them by itself, as its configuration documentation (opens in a new tab) describes. The red cross on the icon means pgAdmin isn’t connected yet.

Double-click PostgreSQL 19. pgAdmin asks for the password of the postgres user:

Type the password you chose when you installed PostgreSQL, the same one psql asks for. Tick Save Password so pgAdmin doesn’t ask again, then click OK.
Note: The desktop version of pgAdmin keeps saved passwords in your computer’s own password store, so it doesn’t ask you for a master password, as the pgAdmin documentation (opens in a new tab) explains.
pgAdmin connects. The red cross disappears, the server opens to show Databases, Login/Group Roles and Tablespaces, and the Dashboard tab shows live graphs of what the server is doing:

Step 3: Find Your Way Around the Object Explorer
Double-click Databases, then postgres, then Schemas, then public:

- Databases: every database on the server.
postgresis the default one, which you connected to with psql in Part 2. - Schemas › public: a schema (opens in a new tab) holds tables and other objects, and every new database starts with one named
public. Its Tables folder is empty for now: Part 4 creates a database of your own, and later parts add tables to it. - Login/Group Roles: the roles (opens in a new tab), PostgreSQL’s name for users and groups of users, such as
postgres. - Tablespaces: places on disk (opens in a new tab) where PostgreSQL can keep its files. You can leave them alone.
Step 4: Open the Query Tool
Click postgres to select the database, then click the Query Tool button: the second icon in the toolbar above the tree, a database with a small arrow. A new tab opens:

The tab’s name, postgres/postgres@PostgreSQL 19, shows the database, the user and the server the Query Tool is connected to. You type SQL in the editor at the top, and results appear in Data Output below it.
Step 5: Run Your First Query
Type this in the editor:
SELECT version();
Press F5, or click the Execute script button, the triangle in the toolbar. The result appears in Data Output:

It’s the same answer psql gave you in Part 2: the version of the PostgreSQL server you’re connected to.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Typing the wrong password | password authentication failed for user "postgres" | Type the password you chose when you installed PostgreSQL; it’s the same one psql asks for. |
| Clicking Add New Server when PostgreSQL 19 is already listed | You end up with two entries for the same server. | Use the entry pgAdmin already lists, and remove the extra one, as How to Remove a Server from pgAdmin 4 shows. |
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| PostgreSQL 19 isn’t listed under Servers | pgAdmin found no PostgreSQL installation on this computer, for example because your server runs on another machine. | Add it yourself, as How to Register a Server in pgAdmin 4 shows. |
Connecting fails with Connection refused | The server isn’t running, or it listens on a different port. | Start PostgreSQL, and check the port: 5432 unless you changed it. |
FAQ
Is pgAdmin part of PostgreSQL?
No. pgAdmin is a separate, free and open-source project with its own versions: this part uses pgAdmin 4 9.19 with PostgreSQL 19. The PostgreSQL installer for macOS offers to install it for you.
Can I use pgAdmin and psql at the same time?
Yes. Both are clients of the same server, as Part 1 explains, so you can keep both open and use whichever suits the job.
Conclusion
You opened pgAdmin, connected it to PostgreSQL 19, looked around the Object Explorer and ran your first query in the Query Tool. From now on, you can follow the SQL in every part in psql or in pgAdmin, whichever you prefer.
← Previous: Part 2: Connect with psql and Run Your First Commands
Next → Part 4: Create a Database: create the bookstore database that the rest of the tutorial builds on, and connect to it.
Additional Resources
- pgAdmin 4 documentation: Connect to Server (opens in a new tab)
- pgAdmin 4 documentation: Query Tool (opens in a new tab)
- pgAdmin 4 documentation: User Interface (opens in a new tab)
- PostgreSQL 19 documentation: Schemas (opens in a new tab)
- PostgreSQL Tutorial for Beginners: every part and setup guide
Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada, and used with their permission.
0 comments