So, it turns out that I just needed to write sudo su postgres without the -. I then entered my user password, wrote psql, entered the password and then I was able to interact with Postgres using the command line.

If you're having difficulty as I was, try this and set the path as I did in my original post.

Answer from IamWarmduscher on Stack Overflow
🌐
Codementor
codementor.io › community › getting started with postgresql on mac osx
Getting Started with PostgreSQL on Mac OSX | Codementor
March 25, 2019 - Drop down the Options and select “Show All Databases” – otherwise you’ll wonder where your databases are! ... Then click the ‘Connect’ button. You’re done! ... Read the Postico Documentation to learn how to use Postico’s amazing features! pgAdmin is the oldest of the Postgres GUIs, its first version being released just a few months after Postgre’s first release in 1996. Having been rewritten several times, it can run on Linux, MacOSX, and Windows, and features powerful database management tools including a syntax-highlighted SQL editor.
Discussions

postgresql - How to run psql on Mac OS X? - Database Administrators Stack Exchange
I installed PostgreSQL on a computer with Mac OS X using the One click installer. Then I try to access PostgreSQL using the psql command, but it doesn't seem to be available. I get this message: ... More on dba.stackexchange.com
🌐 dba.stackexchange.com
May 28, 2011
macos - Accessing postgresql server over network in Mac - Stack Overflow
I have installed Postgres App on my Mac and have a database running. I am able to connect it from the terminal by using the command psql -h localhost Now I want to access this server from another More on stackoverflow.com
🌐 stackoverflow.com
How to get started local [Mac OS]
You'd probably be better off with Postgres.app More on reddit.com
🌐 r/PostgreSQL
7
1
November 26, 2016
How to use PostgreSQL on Docker on Mac M1?
use docker compose and add a postgres container like this: postgres: container_name: postgres image: postgres:14.3-alpine environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: whatever POSTGRES_HOST_AUTH_METHOD: trust ports: - 5432:5432 then your app running in docker as as sibling in the docker-compose file just connects to a host named "postgres" More on reddit.com
🌐 r/PostgreSQL
4
3
June 5, 2022
🌐
Medium
medium.com › @viviennediegoencarnacion › getting-started-with-postgresql-on-mac-e6a5f48ee399
Getting started with PostgreSQL on Mac | by Vivi E | Medium
July 12, 2018 - I decided to add a section where I solved the errors encountered along the way. To get to the PostgreSQL terminal, open your terminal, start the database services (brew services start postgresql), then run psql.
🌐
EnterpriseDB
enterprisedb.com › postgres-tutorials › connecting-postgresql-using-psql-and-pgadmin
Connecting PostgreSQL using psql and pgAdmin | EDB
For PostgreSQL: -bash-4.2$ psql -d postgres -U postgres · For Advanced Server: -bash-4.2$ psql -d edb -U enterprisedb · If connecting to a remote server from any of the operating systems, you can pass on the specific parameters in the following format: bash-4.2$ psql -h <hostname or ip address> -p <port number of remote machine> -d <database name which you want to connect> -U <username of the database server>
🌐
Atlassian
atlassian.com › data › sql › how to start a postgresql server on mac os x
How to Kickstart PostgreSQL on Mac OS X | Atlassian
December 9, 2019 - To do this, the following command can be run in the terminal: 1sudo mkdir -p /etc/paths.d && echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp · Once this is done, the ‘postgres’ database can ...
🌐
Medium
senoritadeveloper.medium.com › install-and-connect-to-postgresql-on-mac-ed692efc9f14
Install and Connect to PostgreSQL on Mac | by Nil Seri | Medium
November 17, 2021 - A terminal opens, waiting for your commands (I double clicked “template” randomly): ... sudo mkdir -p /etc/paths.d && echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp ...
🌐
Postgres.app
postgresapp.com
Postgres.app – the easiest way to get started with PostgreSQL on the Mac
Done! You now have a PostgreSQL server running on your Mac with these default settings: To connect with psql, double click a database. To connect directly from the command line, type psql.
Find elsewhere
🌐
SQL Shack
sqlshack.com › setting-up-a-postgresql-database-on-mac
Setting up a PostgreSQL Database on Mac
April 23, 2021 - In this article, we have learned how to install the Postgres database on a MacOS and use the terminal and PGAdmin to use it.
🌐
DEV Community
dev.to › lorena_dvila_5ab5ef35ec6 › 1-quick-guide-to-setting-up-postgresql-on-mac-via-cli-with-homebrew-3548
1. Quick Guide to Setting Up PostgreSQL on Mac via CLI with Homebrew - DEV Community
May 14, 2026 - Homebrew automatically creates a default superuser matching your Mac username with a blank password. You do not need a password yet. Connect directly to the default postgres template database by running: ... Your terminal prompt will change to postgres=#. You are now inside the database engine.
🌐
KB Hosting
kb.hosting.com › docs › connect-to-postgresql-from-the-command-line
Connecting to PostgreSQL using the command line - hosting.com
To connect to PostgreSQL from the command line, follow these steps: Log in to your account using SSH. At the command line, type the following command. Replace dbname with the name of the database, and username with the database username: ... ...
🌐
Medium
medium.com › @xueyingli66 › start-using-postgresql-with-terminal-on-mac-787ab643c817
Start Using PostgreSQL with Terminal on Mac | by Shirley Li | Medium
May 21, 2020 - ... After the completion of the ... stop postgresql · Once we start PostgreSQL, now we can enter the PostgreSQL interactive terminal with the command psql....
🌐
Shenlu
shenlu.me › blog › setting-up-local-postgresql-database-on-macos
Setting up Local PostgreSQL Database on MacOS - Shen Lu
May 20, 2025 - First, download Postgres.app from https://postgresapp.com/, move to Applications folder, and Double Click · Once the app is open, click “Initialize” to create a new PostgreSQL server. To use PostgreSQL in the terminal, you need to add its binaries to your system path.
🌐
QueryPlane
queryplane.com › blog › install-psql-mac
How to Install psql on Mac: 3 Quick Methods - QueryPlane Blog
February 13, 2026 - For most Mac users, brew install postgresql@17 is the right starting point — you get psql, the server, and all client tools in one command. If you only need the client (no local server), brew install libpq gives you a lighter installation.
🌐
YouTube
youtube.com › watch
Set up a local PostgreSQL Database on macOS - YouTube
In this video we look at how easy it is to get a PostgreSQL server running locally on macOS. We step through installing the Postgres App, initializing a user...
Published   July 23, 2021
🌐
Alvin Alexander
alvinalexander.com › blog › post › postgresql › how-start-postgres-postgresql-server-mac-osx
Mac OS X Postgresql: How to start a Postgres server on a Mac | alvinalexander.com
June 4, 2016 - A long time ago I followed this ... created on my Mac during the installation process. So, Step 1 of starting Postgres is to open a Terminal window, and switch over to that user account, like this:...
🌐
TigerData
tigerdata.com › learn › how-to-install-postgresql-on-macos
How to Install PostgreSQL on MacOS | Tiger Data
December 11, 2025 - To confirm that PostgreSQL is installed correctly, open the terminal on your Mac and run the following commands: cd /Library/PostgreSQL/16/bin ./psql -d postgres -U postgres -h localhost -p 5432Copy · When prompted, enter the password for the postgres user. If the installation is successful, you should be able to connect to PostgreSQL.
🌐
freeCodeCamp
freecodecamp.org › news › manage-postgresql-with-psql
How to Manage PostgreSQL Databases from the Command Line with psql
October 3, 2025 - So enter psql -d postgres -U postgres to connect to the postgres database as the postgres superuser. ... You will be prompted for a password. Enter the password you chose when you installed PostgreSQL on your computer.