Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Note - How completely uninstall PostgreSQL 9.X on Mac OSX

This blog post has helped me clean up my postgres development environment on Mac. So making a copy!

How completely uninstall PostgreSQL 9.X on Mac OSX

This article is referenced from stackoverflow:

If installed PostgreSQL with homebrew , enter brew uninstall postgresql

If you used the EnterpriseDB installer , follow the following step.

Run the uninstaller on terminal window

sudo /Library/PostgreSQL/9.X/uninstall-postgresql.app/Contents/MacOS/installbuilder.sh

If installed with Postgres Installer, do:

open /Library/PostgreSQL/9.X/uninstall-postgresql.app

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
@PetengDedet

This comment has been minimized.

Copy link

PetengDedet commented Jan 23, 2018

Thanks

@ehsan-elwan

This comment has been minimized.

Copy link

ehsan-elwan commented Jan 25, 2018

Thank you very much! it works

@Jontronics

This comment has been minimized.

Copy link

Jontronics commented Jan 25, 2018

awesome

@GProSoftware828

This comment has been minimized.

Copy link

GProSoftware828 commented Feb 6, 2018

Tried:

Georgies-MBP:devcampPortfolio georgie$ brew uninstall postgresql
Error: Refusing to uninstall /usr/local/Cellar/postgresql/10.1
because it is required by libpqxx 6.0.0_1, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies postgresql

Trying to uninstall Postgres and reinstall because db:migrate gives me this:

PG::ConnectionBad: FATAL: database "DevcampPortfolio_development" does not exist

No listing database.

Thoughts? Help?

It was uninstalled, but still occupying the port it installed on. Reinstalling was ineffective because the port was taken...

@karanisverma

This comment has been minimized.

Copy link

karanisverma commented Mar 25, 2018

Thanks a lot @altas7

@enriquezrene

This comment has been minimized.

Copy link

enriquezrene commented Apr 11, 2018

Awesome, thank you

@shi-xiaopeng

This comment has been minimized.

Copy link

shi-xiaopeng commented Apr 13, 2018

Thank you! It helps a lot

@vfautsch

This comment has been minimized.

Copy link

vfautsch commented Apr 15, 2018

Great guide, thanks!

@auraz

This comment has been minimized.

Copy link

auraz commented Apr 20, 2018

Thanks

@grassiricardo

This comment has been minimized.

Copy link

grassiricardo commented Apr 21, 2018

Tranks

@ArnaldoSena

This comment has been minimized.

Copy link

ArnaldoSena commented Apr 30, 2018

It's work! Thanks!

@drewdle

This comment has been minimized.

Copy link

drewdle commented May 18, 2018

Thanks... but for some reason, on my start screen, the Postgres user persists. In the system prefs, the user is not listed at all.

@Marcos-Branquinho

This comment has been minimized.

Copy link

Marcos-Branquinho commented May 28, 2018

worked for me! Thanks a lot!

@mrioqueiroz

This comment has been minimized.

Copy link

mrioqueiroz commented Jul 1, 2018

Thanks!

@eeliwan

This comment has been minimized.

Copy link

eeliwan commented Jul 8, 2018

Thanks!

@frmendez

This comment has been minimized.

Copy link

frmendez commented Jul 9, 2018

thanks

@celsooliveiraTBDE

This comment has been minimized.

Copy link

celsooliveiraTBDE commented Jul 15, 2018

Still works like a charm.

@vl4dt

This comment has been minimized.

Copy link

vl4dt commented Jul 18, 2018

Worked like a charm. very nice!

@kirpheaice

This comment has been minimized.

Copy link

kirpheaice commented Jul 27, 2018

Thank you very much.

@stella3d

This comment has been minimized.

Copy link

stella3d commented Aug 17, 2018

thank you, this worked great

@MartinAlex12

This comment has been minimized.

Copy link

MartinAlex12 commented Aug 21, 2018

I was trying to uninstall with Terminal but I was getting error. Then I tried another way to uninstall from this article and it helped

@tsonny

This comment has been minimized.

Copy link

tsonny commented Aug 27, 2018

TY SOOOOOOOOO MUCH!!!!

@mtazzari

This comment has been minimized.

Copy link

mtazzari commented Sep 10, 2018

Great checklist!

@ws-kadirmaev

This comment has been minimized.

Copy link

ws-kadirmaev commented Oct 2, 2018

You are the best! Thanks a lot!

@yannlr37

This comment has been minimized.

Copy link

yannlr37 commented Oct 5, 2018

Thanks !

@jlbokass

This comment has been minimized.

Copy link

jlbokass commented Oct 8, 2018

Thank you ! it works very well!

@ec-wagner

This comment has been minimized.

Copy link

ec-wagner commented Oct 21, 2018

Note for macOS High Sierra

  • last step: sudo rm /etc/sysctl.conf --> error: /etc/sysctl.conf: No such file or directory
@Makesh

This comment has been minimized.

Copy link

Makesh commented Oct 25, 2018

Thank you !!!!!!!!!!!!!!

@sugarac

This comment has been minimized.

Copy link

sugarac commented Oct 31, 2018

shit. useless

@kissferenc

This comment has been minimized.

Copy link

kissferenc commented Jan 5, 2019

thx!

@taka2477

This comment has been minimized.

Copy link

taka2477 commented Feb 11, 2019

Thx a lot!!

@kerimsari

This comment has been minimized.

Copy link

kerimsari commented Feb 14, 2019

Thank you!! Mille Merci...

@mbifulco

This comment has been minimized.

Copy link

mbifulco commented Mar 20, 2019

So glad I found this. Thank you!

@Ibrahimahadi

This comment has been minimized.

Copy link

Ibrahimahadi commented Apr 16, 2019

NICE

@ramsesls

This comment has been minimized.

Copy link

ramsesls commented May 22, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.