Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Completely remove postgres after brew uninstall OSX

I would like to know how to completely remove PostgreSQL on macOS Sierra (10.13.6). I've used this command line:

brew uninstall postgres

But when I reinstall with brew install postgres I have the old config & content. I would like to make fresh install.

like image 233
Mattasse Avatar asked Dec 24 '22 04:12

Mattasse


1 Answers

for completely reinstalling postgresql initially run brew doctor and brew update

now uninstall postgresql by running

brew uninstall postgresql
rm -rf /usr/local/var/postgres
rm -rf .psql_history .psqlrc .psql.local .pgpass .psqlrc.local

now reinstalling postgresql will not bring back the previous configs and content

like image 115
TheLooseCannon Avatar answered Feb 21 '23 09:02

TheLooseCannon