Completely uninstall PostgreSQL 9.0.4 from Mac OSX Lion?
This question may look like a duplicate of: How to uninstall postgresql on my Mac (running Snow Leopard) however, there are two major differences. I’m running Lion and I’m trying to uninstall PostgreSQL 9.0.4. I’ve looked at the last question and the link that it referenced, but I did not find a file called «uninstall-postgresql» when I run this command:
So, I assume this means that the uninstall process for 9.0.4 is different than that of 8.x.
I’ve seen a couple of posts in different places describing a method for manual uninstallation but, similarly, some of the directories/files referenced are not present on my machine.
Any assistance or direction you can provide would be greatly appreciated.
Just for reference, this is the link the other poster used to uninstall postgres from snow leopard. As I tried to step through these commands, most of them choked with some variant of «command not found».
In addition to brew uninstall postgres , should I remove any of the following files/directories manually? Keep in mind I want to completely wipe the slate clean, no data files/database tables or anything.
Uninstall PostgreSQL
PostgreSQL is not typically problematic, but if you get some issues with it, it is recommended to reinstall the program instead of trying to fix the problem. So in this article, we are going to explain how to uninstall PostgreSQL on a Mac easily and quickly.
How to remove PostgreSQL using terminal
First, you should stop Postgres server on your Mac. For this, click on the Elephant icon in the toolbar and select Shutdown server.
If you installed Postgres with its Installer, then you can use the Terminal command line to remove Postgres. For this, go to the Applications folder →Utilities → open Terminal → and run the uninstaller using the following command:
If you encounter the message that this file does not exist, then skip to Method 2 of PostgreSQL removal. If the command runs the uninstaller, proceed to the next steps.
Enter the administrator password to launch the uninstaller. Then follow the provided steps to remove the PostgreSQL and data folders.
Unfortunately, the root uninstaller doesn’t delete all service files of the program, so you will need to remove them manually. For this, use the commands below:
- Remove the ini file:
sudorm /etc/postgres-reg.ini - Remove the PostgreSQL folder from the system Library:
sudo rm -rf/Library/PostgreSQL - Remove the PostgreSQL user. Go to System Preferences → Users & Groups → click the Lock icon and enter the administrator password to unlock settings → select the PostgreSQL and click the “-” icon.
- Restore your shared memory settings using this command: sudo rm /etc/sysctl.conf
That’s all with the first method of removal. Now, let’s learn the second method, which you will most likely find easier and more convenient.
How to remove PostgreSQL using
App Cleaner & Uninstaller
App Cleaner & Uninstaller is a removal tool for any kind of program on Mac. With this uninstaller, you can uninstall PostgreSQL well. Here are a few steps to do that:
- Download App Cleaner & Uninstaller and launch it.
- Confirm access to your Applications folder and it will start scanning it to find the installed apps on your Mac. Then you will see a list of apps in the left section. Find and select the PostgreSQL folder. In the right section, you can preview all executable files, support files, cache and all types of file related to PostgreSQL.
- Click the Remove button and confirm the removal of the selected files.
Note that App Cleaner & Uninstaller automatically detects all the support files of the apps, so you don’t need to search for and remove them manually. If you already deleted PostgreSQL in the regular way, you can find the leftovers of the program in the Remaining Files tab.
That’s all. As we promised, easy and fast!
App Cleaner & Uninstaller
Disable startup programs. Manage system extentions.
Uninstall applications completely.
Atlas7 / remove_postgres_on_mac_os.md
This blog post has helped me clean up my postgres development environment on Mac. So making a copy!
This comment has been minimized.
Copy link Quote reply
PetengDedet commented Jan 23, 2018
This comment has been minimized.
Copy link Quote reply
ehsan-elwan commented Jan 25, 2018
Thank you very much! it works
This comment has been minimized.
Copy link Quote reply
Jontronics commented Jan 25, 2018
This comment has been minimized.
Copy link Quote reply
GProSoftware828 commented Feb 6, 2018 •
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.
It was uninstalled, but still occupying the port it installed on. Reinstalling was ineffective because the port was taken.
Complete uninstall of Postgresql from Mac OSX problems [closed]
Want to improve this question? Update the question so it’s on-topic for Stack Overflow.
Closed 7 years ago .
Initially I wanted to uninstall PSQL from my system and switch to postgres app, version 9.2.
Followed this guide closely, but still have problems with postgresql being active on my system.
Since this is out of my competencies, and I have no idea what it does, I am asking you guys.
1 Answer 1
The files in /usr/bin are a part of your operating system, and among the numerous suppliers of PostgreSQL installers or packages for Mac OS X, I think none of them ever suggests to delete /usr/bin/psql .
In fact there are quite a few more files that you would delete, should you want to wipe out the PostgreSQL client layer as shipped by Apple. And when you’ll upgrade that system to 10.8.X+1 or whatever, the Apple installer may well put them back again with newer versions.
Как удалить postgresql на моем Mac (работает Snow Leopard)
Обновлено 10.6 от 10.5, и теперь postgres 8.1 взломан. Чтобы сделать вещи хуже, я попытался установить 8.4, который я уверен, просто сделал вещи в десять раз хуже. Во всяком случае, исключение, которое я получаю, когда пытаюсь запустить postgres и просто createuser, таково:
createuser: не удалось подключиться к база данных postgres: не удалось подключиться к серверу: нет такого файла или каталога Работает ли сервер локально и прием соединений в домене Unix разъем «/ПТМ./С. Список pgsql.5432»?
Как мне полностью избавиться от postgres на моем Mac, чтобы я мог сделать переделку?
3 ответов
проблема была с учетной записью PostgreSQL, сидящей на моей машине.
Я удалил учетную запись и продолжил удаление, используя инструкции здесь:
Автоматическое Удаление:
в каталоге установки будет uninstall-postgresql.файл приложения. Выполнение (двойной щелчок), которое удалит установку PostgreSQL.
Вручную Удалить:
удалить ярлыки меню :
Удаление Элементов Автозагрузки :
удалить данные и установленные файлы:
удалить пользователя postgres:
Я могу добавить эту крошечную команду к ответу тоже:
удалить исполняемый псевдоним psql.
Если у вас есть более новая версия Postgres и/или OSX / macOS, вы можете проверить ответ.
Uninstall Postgres 10 on macOS – EnterpriseDB installer
Title says it all… How to completely remove a Postgres cluster from a macOS computer?
I used the installer app provided by EnterpriseDB as a courtesy to the community.
This uninstallation question has been asked multiple times on Stack Overflow. But those questions and answers are years out-of-date.
2 Answers 2
postgres user
The user account named postgres (by default) created by the installer is actually a macOS user account.
- Apple allows deleting a user account in the more recent versions of macOS: System Preferences > Users & Groups > — button in list, after authenticating with padlock icon in lower corner.
- In older macOS versions that do not delete user accounts, you may be able to hide that user account.
Every other trace of Postgres can be removed.
Backup/Export
Of course, first backup your database with a tool like pgBackup. And/or export your data.
Uninstaller app
The installer app provided by EnterpriseDB does install an app named Uninstaller . Find it in the Postgres folder, probably located at the root Library folder (not the Library folder in your home folder).
Run that uninstaller app, and supply your macOS system password. After the run, the data folder remains as that is owned by the postgres user rather than your regular macOS user. The uninstaller app reminds you of this fact.
data folder
Select that data folder in the Finder, and choose File > Move to trash . When prompted, provide your own macOS user account password.
Delete that outer Postgres folder(s) that contained data .
Applications folder
Remove the PostgreSQL 10 folder in your Applications folder if it remains. Again, provide your own macOS user account password.