DEV Community

Maria Campbell
Maria Campbell

Posted on • Updated on

Installing pgAdmin Only after installing PostgreSQL with Homebrew

pgAdmin

This post was first published on my developer blog on June 15, 2018.

Update June 17, 2018: I revisited this issue just now and the set up really is easy. I will be writing a post on this and will link it to here. I much prefer using Homebrew, especially for local development, but I also like having the ability to use a GUI. This set set up just makes life so much easier if you want to push your local repo to remotes such as Github! To view my post entitled Installing pgAdmin Only after installing PostgreSQL with Homebrew Part 2 here, please visit Installing pgAdmin Only after installing PostgreSQL with Homebrew Part 2.

I recently started to learn PostgreSQL, and installed it on my Mac High Sierra with Homebrew. Today, I decided to delve much deeper into it and found a couple of interesting courses on it on Udemy (my course at NYCDA was severely lacking). I hadn’t installed pgAdmin with Homebrew previously because it is severely outdated, but decided I should give it a try on the pgAdmin website. I installed it and tried to log in. I received the message that the role postgres was missing, and I could not log in. That is because I had chosen to use my computer shortname instead. I decided to investigate the matter.

After some searching, I came up with the following from Stackoverflow:

psql: FATAL: role “postgres” does not exist

The part that worked for me, and should for anyone else in a similar situation, is the following in the thread:

@RogerLipscombe if you run brew link postgresql after the installation, there's no need to append the whole path to createuser, a simple createuser -s postgres will work great
Enter fullscreen mode Exit fullscreen mode

It is a comment there, and it worked like a charm! I went back into pgAdmin, the GUI recognized my new postgres user, and I was able to log in.

For me, using Homebrew to manage my activity in postgres was the way to go, but I also wanted to be able to go into the pgAdmin GUI and get a comprehensive overview of my database activity.

Hope this helps, and happy pgAdmining!

Related Resources:
How to uninstall postgreSQL on OSX and reinstall with Homebrew

Latest comments (1)

Collapse
 
letsbsocial1 profile image
Maria Campbell • Edited

I revisited this approach, and it really did end up easy to implement both a Homebrew postgresql install and a pgAdmin GUI. See update at the top of the post. Thanks!