2

I've been having some difficulty getting up and running with PostgreSQL. Having uninstalled PostgreSQL with brew uninstall postgresql and uninstalled/removed Postgres.app I re-installed Postgresql.app. When initializing the .app I was still getting this error message:

Postgres.app Error Message

Per Postgresql.app's documentation, I looked at my Activity Monitor and saw nothing named postgres or postmaster:

Activity Monitor

I found this helpful answer and after sudo find / -iname createdb discovered I had a createdb file living in /Library/PostgreSQL/9.5/bin/createdb who contents include "pgAdmin3.app" which is no longer supported. (I am presuming I installed it when I first started looking into PostgreSQL and wasn't really thinking... whoops!) I also searched for pg_hba.conf files and found I have a postgres directory in my usr dir: /usr/local/var/postgres/pg_hba.conf

Is removing the Library's folder (/Library/PostgreSQL/) adequate for a complete uninstallation of pgAdmin3, or are there other files and directories to remove? For example, should I also delete /usr/local/var/postgres/? Any advice is greatly appreciated, thank you.

NOTE:
per pgAdmin3's uninstall site, ls -al /Applications | grep pgAdmin returns nothing.

per this similar question on another SE site, sudo find / -iname .pg* reveals nothing. Also, per the answer to that question, ~/Library/Preferences/ does not contain: org.postgresql.pgadmin.plist.lockfile org.postgresql.pgadmin.plist pgadmin3 Preferences

per the comments in this answer it looks like I should remove the /usr/local/var/postgres/ directory manually. And from the question, I also invoked sudo find / -name "*postgres*" and got a whole bunch of listings. Of note, I see that BlackMagic's DaVinci Resolve is using a PostgreSQL server. The install timestamp of pgAdmin3 is the same as when I installed Resolve... ? Not sure what I need to do.

This forum conversation sheds some light on Resolve's PostgreSQL server removal.

UPDATE: per comments, when I launch Activity Monitor as admin:

sudo "/Applications/Utilities/Activity Monitor.app/Contents/MacOS/Activity Monitor"

...I see these processes associated with user:postgres Activity Monitor, active postgres processes

Should I quit these processes before deleting the contents of /Library/Postgres/... and other associated files like:
/Library/LaunchDaemons/com.edb.launchd.postgresql-9.5.plist

/Library/Application Support/Blackmagic Design/DaVinci Resolve/Prereqs/config_postgres.sh
/Library/Application Support/Blackmagic Design/DaVinci Resolve/Prereqs/install_postgres.sh
/Library/Application Support/Blackmagic Design/DaVinci Resolve/Prereqs/postgresql.zip
/Library/Application Support/Blackmagic Design/DaVinci Resolve/Prereqs/upgrade_postgres.sh

&

/private/var/db/dslocal/nodes/Default/groups/_postgres.plist
/private/var/db/dslocal/nodes/Default/users/_postgres.plist
/private/var/db/dslocal/nodes/Default/users/postgres.plist
/private/var/folders/gv/jzhl4n_j2gz6_hjvq4f2xq9h0000gn/C/com.postgresapp.Postgres2
/private/var/folders/gv/jzhl4n_j2gz6_hjvq4f2xq9h0000gn/C/com.postgresapp.Postgres2MenuHelper

&

/Users/<user_name>/Library/LaunchAgents/com.postgresapp.Postgres2LoginHelper.plist
/Users/<user_name>/Library/Logs/Homebrew/postgresql
/Users/<user_name>/Library/Preferences/com.postgresapp.Postgres2.plist
/Users/<user_name>/Library/Preferences/com.postgresapp.Postgres2MenuHelper.plist
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/postgres
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/check_postgres.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/postgres-xc.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/postgresql.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/postgrest.rb
/usr/local/var/homebrew/locks/postgresql.brewing
/usr/local/var/postgres
/usr/local/var/postgres/postgresql.auto.conf
/usr/local/var/postgres/postgresql.conf

Maybe I can leave the Homebrew dir/files?

Note: found these with sudo find / -name "*postgres*"

Also per this github blog, should I "Restore shared memory settings" with sudo rm /etc/sysctl.conf

  • 2
    pgAdminIII is not the tool using the 5432 port. pgAdmin is a client application, not a server listening on port 5432. Most probably you still have one PostgreSQL installation, and it is running. When checking activity monitor, make sure you're watching all processes (i.e. include system processes) and not just the ones corresponding to you. From your picture, it looks like you're just checking "My processes". The postgres or postmaster processes are normally run by the postgres user. – joanolo Jan 6 '17 at 1:43
  • 1
    That's a really tough question, because it depends completely on how you installed them in the first place (source code copilation + make + make install does one thing; brew install does another one; the installers from BigSQL and EDB yet another, and Postgres.app...). First step: how did you installed it, second step: look for documentation about how to uninstall it. If you find nothing, check at least Activity Monitor, Open Files and Ports, and see where are your executables and data. – joanolo Jan 6 '17 at 1:54
  • 1
    pgAdmin can coexist with all other tools. And you can have several versions of PostgreSQL installed (or several instances of the same version of PostgreSQL), as far as they don't all try to use the same port. You can configure Postgres.app to use port 5433, for instance. The port setting for a certain PostgreSQL installation is specified in the postgresql.conf file of that installation. If you use Postgres.app, you have a preferences menu where you can chosse (or check) the folder of this file. – joanolo Jan 6 '17 at 2:05
  • 1
    You need to start "Activity Monitor" as "root", that is, open a Terminal and type sudo "/Applications/Utilities/Activity Monitor.app/Contents/MacOS/Activity Monitor". From this point on, you will be able to "see everything" from Activity Monitor. [And you'll see that the menu bar is greyish] – joanolo Jan 6 '17 at 2:28
  • 1
    Check forum.blackmagicdesign.com/viewtopic.php?t=37603, changing version as needed. – joanolo Jan 6 '17 at 7:08
4

Well, turns out I had pgAdmin3 installed by DaVinci Resolve 12.5.4's installer and their uninstaller didn't get rid of all the components it installed.

I deleted this file: /Library/LaunchDaemons/com.edb.launchd.postgresql-9.5.plist and was able to reboot without the postgres processes launching - note to use Activity Monitor as admin and displaying "All Processes"
sudo "/Applications/Utilities/Activity Monitor.app/Contents/MacOS/Activity Monitor"

I then deleted the entire contents of:
/Library/PostgreSQL/...
/usr/local/var/postgres/...
/Library/Application Support/Blackmagic Design/...

and other non rbenv & homebrew "postgres" files (tho I did nuke the homebrew postgres log) I found using sudo find / -name "*postgres*"

I've seen a couple "uninstalling" posts, and this one recommended using
sudo rm /etc/sysctl.conf but I don't think it applies to OSX Sierra's install of pgAdmin3 components from the DaVinci Resolve installer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.