I put together these notes to help diagnose and repair PostgreSQL installations and other problems.
You either installed it via Homebrew, or you installed it via download at postgresapp.com. Either is fine. Most problems I see with PostgreSQL come from Homebrew.
If you installed BOTH you need to decide which one to remove.
Homebrew handles this for you, so that points me to running the postgressapp.com version. If you DO use Homebrew, stop here and contact me to help diagnose.
For postgresapp.com folks, try the following command, substituting YOURUSERNAME for whatever your laptop username is (run whoami
at a terminal prompt if you're unsure):
$ /usr/local/opt/postgres/bin/createuser -s YOURUSERNAME
This should make you a "superuser" with the ability to create/drop entire databases and so on.
Vimeo walkthrough - 10 minutes
Try this:
$ ps aux | grep post
This command will look at all processes running and filter only things containing the word "post". If the only line of output shows the "grep post" then PostgreSQL is definitely NOT running.
$ sudo rm /usr/local/var/postgres/postmaster.pid
Then try starting PostgreSQL again (brew servies start postgresql
)
Then try the ps aux | grep post
command above to see if there are more PostgreSQL processes running. If so, you should be all set.
You probably have both Homebrew AND the postgressapp.com versions installed, and you need to remove one and keep the other.
Send me a DM on Slack, we'll get on a Zoom call where we record the call and I'll help you diagnose it, and then I'll update this document and link your video.