I've been trying to get this to work by following the answers in these questions:
.
me@myMac:~$ cd /Library/PostgreSQL/14
me@myMac:/Library/PostgreSQL/14$ ./uninstall-postgresql.app/
-bash: ./uninstall-postgresql.app/: is a directory
me@myMac:/Library/PostgreSQL/14$ open ./uninstall-postgresql.app/
LSOpenURLsWithRole() failed with error -10810 for the file /Library/PostgreSQL/14/uninstall-postgresql.app.
me@myMac:/Library/PostgreSQL/14$ open -a ./uninstall-postgresql.app/
Unable to find application named './uninstall-postgresql.app/'
me@myMac:/Library/PostgreSQL/14$ open -a uninstall-postgresql.app/
Unable to find application named 'uninstall-postgresql.app/'
me@myMac:/Library/PostgreSQL/14$ sudo open uninstall-postgresql.app/
Password:
LSOpenURLsWithRole() failed with error -10810 for the file /Library/PostgreSQL/14/uninstall-postgresql.app.
me@myMac:/Library/PostgreSQL/14$ cd /Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS/
me@myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ install
install install_name_tool installvst
install-info installer
me@myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ installer
Usage: installer [-help] [-dominfo] [-volinfo] [-pkginfo] [-allowUntrusted] [-dumplog]
[-verbose | -verboseR] [-vers] [-config] [-plist]
[-file <pathToFile>] [-lang <ISOLanguageCode>] [-listiso]
[-showChoicesXML] [-applyChoiceChangesXML <pathToFile>]
[-showChoicesAfterApplyingChangesXML <pathtoFile>]
-pkg <pathToPackage>
-target <[DomainKey|MountPoint]>
me@myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ installbuilder.sh
-bash: installbuilder.sh: command not found
SINCE I couldn't run/find installbuilder.sh
using the following command...
me@myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ installbuilder.sh
-bash: installbuilder.sh: command not found
...as the other answers in my OP suggest, I went on to try the steps below:
me@myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ ls -la
total 3112
drwxr-xr-x 5 root daemon 160 Sep 23 10:48 ./
drwxr-xr-x 5 root daemon 160 Sep 23 09:18 ../
-rwxr-xr-x 1 root daemon 673 Sep 23 10:48 installbuilder.sh*
-rwxr-xr-x 1 root daemon 1449456 Sep 23 10:07 osx-x86_64*
-rwxr-xr-x 1 root daemon 135216 Jul 14 11:21 uninstall-postgresql*
me@myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ ./installbuilder.sh
Unable to initialize installer
me@myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ ./uninstall-postgresql
Usage: ./uninstall-postgresql installerName [args ...]
me@myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ ./uninstall-postgresql osx-x86_64
This launched the uninstall GUI
The uninstaller will do its thing and then prompt you with this:
At this point you'll want to follow the steps provided in this PREVIOUS StackOverflow ANSWER - steps 3 through 6 of @user1181328's answer. I'll list them here for convenience:
Remove the PostgreSQL and data folders. The Wizard will notify you that these were not removed.
sudo rm -rf /Library/PostgreSQL
Remove the ini file:
sudo rm /etc/postgres-reg.ini
Remove the PostgreSQL user:
- using System Preferences -> Users & Groups.
- Unlock the settings panel by clicking on the padlock and entering your password.
- Select the PostgreSQL user and click on the minus button.
Restore your shared memory settings:
sudo rm /etc/sysctl.conf
That should be all! The uninstall wizard would have removed all icons and start-up applications files so you don't have to worry about those.