EnterpriseDB: The Enterprise Postgres Company Postgres Plus Forums: The PostgreSQL Open Source Database from EnterpriseDB
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 

Uninstall Postgres  XML

Forum Index » PostgreSQL Installers for Windows, Linux and OS X
Author Message
Christophe_B

New member

Joined: 25 May 2005 05:45:58
Messages: 1
Offline

Hi,

What is the way to uninstall Postgresql, once installed using the .bin installer (postgresql-8.3.3-2-linux.bin) ?

I tried "uninstall-postgresql", but I got "Uninstallation did not complete successfully", and noting changed.

Please, advise.

Best regards,
CB

OS : Debian Etch

This message was edited 2 times. Last update was at 15 Sep 2008 18:50:54

Dave_P

Senior member
[Avatar]

Joined: 26 Sep 2005 12:09:59
Messages: 160
Offline

Christophe_B wrote:Hi,

What is the way to uninstall Postgresql, once installed using the .bin installer (postgresql-8.3.3-2-linux.bin) ?

I tried "uninstall-postgresql", but I got "Uninstallation did not complete successfully", and noting changed.

Please, advise.

Best regards,
CB

OS : Debian Etch


Hmm, strange. Is that the entire message text?

The easiest possible fix would be to re-run the installer, which we've found can fix the uninstaller (they normally only break when we make silly mistakes in development though - and what you have has been thoroughly tested). Then, try re-running the uninstaller.

Failing that, you can try a manual uninstallation (as root, assuming a default installation path):

/opt/PostgreSQL/8.3/installer/server/removeshortcuts.sh /opt/PostgreSQL/8.3 8.3
/etc/init.d postgresql-8.3 stop
rm -rf /opt/PostgreSQL
rm /etc/postgres-reg.ini
rm -rf /etc/init.d/postgresql-8.3
userdel postgres

if /etc/ld.so.conf exists, edit it and remove /opt/PostgreSQL/8.3/lib
if present.

if /etc/ld.so.conf.d exists:

rm /etc/ld.so.conf.d/postgresql-8.3.conf

Ben_P

New member

Joined: 24 May 2005 19:32:21
Messages: 1
Offline

How is an uninstall achieved on OS X?
Sachin_S

Senior member

Joined: 1 Aug 2008 02:37:24
Messages: 486
Offline

In Mac OSX: (Assuming Default Locations)

Via uninstaller:

1) In the installation directory, there will be a uninstall-postgresql.app file will be there, executing (double clicking) that will uninstall the postgresql installation.

Manual Uninstallation:

1) Stop the server

sudo /sbin/SystemStarter stop postgresql-8.3

2) Remove menu shortcuts:

sudo rm -rf /Applications/PostgreSQL 8.3

3) Remove the ini file

sudo rm -rf /etc/postgres-reg.ini

4) Removing Startup Items

sudo rm -rf /Library/StartupItems/postgresql-8.3

5) Remove the data and installed files

sudo rm -rf /Library/PostgreSQL/8.3

6) Delete the user postgres

sudo dscl . delete /users/postgres

--
Regards,
Sachin Srivastava
EnterpriseDB , the Enterprise Postgres company.
ririrourou_r

New member
[Avatar]

Joined: 14 May 2009 10:35:28
Messages: 2
Offline

and what about Windows, i want to uninstall Postgresql from MS DOS? is it possible?
i tried this:
rd /s /q "C:\program files\postgresql"
net user postgres /delete

but it's not enought

Please, advice.

best regards;

thanks
Sachin_S

Senior member

Joined: 1 Aug 2008 02:37:24
Messages: 486
Offline

In Windows:

Via Uninstaller:

i) Go to the Add/Remove Programs and uninstall postgresql server from there or go to the postgresql server installation directory and run the uninstaller.

Manual Uninstallation:

i) Remove the postgresql server installation directory. (rd /s /q "C:\Program Files\PostgreSQL\8.3") Assuming default location.

ii) Delete the user 'postgres' (net user postgres /delete)

iii) Remove the Registry entries. (HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-8.3) and (HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Services\postgresql-8.3)

iv) Remove the postgresql-8.3 service. (sc delete postgresql-8.3)



--
Regards,
Sachin Srivastava
EnterpriseDB , the Enterprise Postgres company.
ririrourou_r

New member
[Avatar]

Joined: 14 May 2009 10:35:28
Messages: 2
Offline

thanks to you I have found the solution
thank you very much
Petrik_O

New member

Joined: 28 May 2009 07:21:16
Messages: 6
Offline

The windows uninstall needs working on for us mere mortals.

I decided to give Postgresql a go after hearing about it all the time. As a result seeing I was going to "give it a go" I gave the initial install [super]usernames, server and database just some silly names, to see how it all worked.

Well now that I want to uninstall/reinstall I can't get it to lose all the silly names. Everytime I try it comes back with those initial setting instead of giving me a clean setup. I have never had this proplem with other software. I will try the above instructions and see if that helps.

The uninstall is not clearing things out properly. Hopefully this will be fixed in the future.

My Linux box at home I setup later so I gave it the names I wanted to use and have not dared to attempt an uninstall to see if it suffers from the same issues.
Sachin_S

Senior member

Joined: 1 Aug 2008 02:37:24
Messages: 486
Offline

Petrick,

All that uninstaller leaves behind is:

i) The service user account 'postgres'

Reason: That account is being used by any other postgresql installations. and if in case user doesnt need it he can manually delete the user as told in previous postings.

ii) The data directory.

Reason: It is not advisable to delete the data directory as it may contains useful information and can be used afterwards (with other postgresql installations) and if in case that directory is not important, user can any time delete it manually.

Apart from the above two, the installer wont delete any file/directory that is being created (within the postgresql installation directory) by the user, after installation.

--
Regards,
Sachin Srivastava
EnterpriseDB , the Enterprise Postgres company.
Petrik_O

New member

Joined: 28 May 2009 07:21:16
Messages: 6
Offline

It looks like the the final fix was the registry. I removed everyting mentioning postgres[ql].

Ideally the windows uninstall through the control panel/add remove programs should deal with registry entries removal. Who knows what damage I've done in there.
Petrik_O

New member

Joined: 28 May 2009 07:21:16
Messages: 6
Offline

Well that got rid of the funny names but has now created another problem I can't work out what to do with.

I install again from the MSI fie (bypassing the option of starting it as a service, I want to start it manually.) and now it does not create a data directory nor do I have my postgres user. I am also not able to add a server in pgadmin III (it shows none and won't let be create one.).
Sachin_S

Senior member

Joined: 1 Aug 2008 02:37:24
Messages: 486
Offline

Petrik,

I suggest you to use the one-click installer (.exe one) because that is maintained by us. and all the above postings were made assuming the user had used the one-click installer only.

--
Regards,
Sachin Srivastava
EnterpriseDB , the Enterprise Postgres company.
Petrik_O

New member

Joined: 28 May 2009 07:21:16
Messages: 6
Offline

I have managed to get back to it and have another go, this time using the .exe installer and I get the following error near the end of the installation

Problem running post-install step. Installation may not complete correctly Error reading file C:/Program Files/PostgreSQL/8.3/data/postgresql.conf

This message was edited 1 time. Last update was at 1 Jun 2009 19:24:21

Sachin_S

Senior member

Joined: 1 Aug 2008 02:37:24
Messages: 486
Offline

Petrik,

Can you please post the contents [error part] of the installation log present in your system's temp directory (%TEMP%\install_postgresql.log). Also, please let us know the version of windows you are using.

--
Regards,
Sachin Srivastava
EnterpriseDB , the Enterprise Postgres company.
Petrik_O

New member

Joined: 28 May 2009 07:21:16
Messages: 6
Offline

I'm on windows XP

I deleted everything postgres I could find and reinstalled (this time to another location) and still got the same error.

Below is the tail end of the log file.


Starting the database server...
Executing cscript
Script exit code: 0

Script output:
Starting postgresql-8.3
Service postgresql-8.3 started successfully
startserver.vbs ran to completion

Script stderr:


Loading additional SQL modules...
Executing cscript
Script exit code: 0

Script output:
Installing pl/pgsql in the template1 databases...
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "???" and accepting
TCP/IP connections on port 5432?

Installing the adminpack module in the postgres database...
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "???" and accepting
TCP/IP connections on port 5432?

loadmodules.vbs ran to completion

Script stderr:


Write the data directory to the ini file...
Write the port number, service ID, locale and superuser to the ini file...
Problem running post-install step. Installation may not complete correctly
Error reading file D:/Installed Software/PostgreSQL/8.3/data/postgresql.conf
Creating Uninstaller
Creating uninstaller 25%
Creating uninstaller 50%
Creating uninstaller 75%
Creating uninstaller 100%
Installation completed
Log finished 06/03/09 at 09:32:51
jeffrey_bailey

New member

Joined: 25 Jul 2010 17:46:36
Messages: 1
Offline

I can't get the uninstall-postgres.app on my mac to show up in the installation directory. Even if I search my mac, it isn't there. I tried downloading the most recent version and upgrading, but it still is not there. Can I download this and put it in the directory manually or something?
Sachin_S

Senior member

Joined: 1 Aug 2008 02:37:24
Messages: 486
Offline

Hello,

The uninstaller will not be created when you run the installer in upgrade mode. You can use these steps to uninstall postgresql from your mac.

i) Stop the server.
sudo launchctl unload /Library/LaunchDaemons/com.edb.launchd.postgresql-8.4.plist

ii) Remove the plist file
sudo rm -f /Library/LaunchDaemons/com.edb.launchd.postgresql-8.4.plist

iii) Remove the Applications Menu.
sudo rm -f "/Applications/PostgreSQL 8.4"

iv) Remove the installation directory
sudo rm -rf /Library/PostgreSQL/8.4
(Note: You can backup your data directory in case you need it.)

v) Remove the 'postgres' user
sudo dscl . delete /Users/postgres
(Note: This step is optional)

vi) Remove the ini file
sudo rm -f /etc/postgres-reg.ini

After these steps, PostgreSQL is completely removed from your system.

You can run the latest installer again to install PostgreSQL (You can also point the installation to use your backed up data directory also). This time it will create the uninstaller.

Hope it helps.

This message was edited 1 time. Last update was at 26 Jul 2010 01:33:32


--
Regards,
Sachin Srivastava
EnterpriseDB , the Enterprise Postgres company.
xjrmame

Member

Joined: 2 Feb 2011 18:37:11
Messages: 20
Offline

Hi ,
I am Using CentOS, Whether anyone have any idea how to uninstall POSGRESQL in Centos?

Thanks
xjrmame

Member

Joined: 2 Feb 2011 18:37:11
Messages: 20
Offline

I just installed PostgreSQL on my OSX Leopard, and the uninstaller does not seem to exist. There is a bug in your installer. I hope my system won't get screwed up.
Sachin_S

Senior member

Joined: 1 Aug 2008 02:37:24
Messages: 486
Offline

Hi,

Can you please copy paste the first and last 10 lines of the installation logs (/tmp/postgresql.log)?

Did you try to upgrade or install a new instance?

--
Regards,
Sachin Srivastava
EnterpriseDB , the Enterprise Postgres company.
sanker_kambhapati

New member

Joined: 24 Nov 2011 06:17:24
Messages: 5
Offline

Hi All,

By mistake i uninstalled db_server, edbmtk and edbpgagent from database server.
Is there anyway to restore the database to the previous point?
Please help me in this issue
Sachin_S

Senior member

Joined: 1 Aug 2008 02:37:24
Messages: 486
Offline

Re-run the installer, and select the ones you uninstalled, this will put back the binaries that you uninstalled. In case of dbserver, you can choose your existing data directory..

--
Regards,
Sachin Srivastava
EnterpriseDB , the Enterprise Postgres company.
sanker_kambhapati

New member

Joined: 24 Nov 2011 06:17:24
Messages: 5
Offline

thank you sachin for your help.....
bebewib

New member

Joined: 26 Jul 2012 03:26:52
Messages: 8
Offline

I'm on OS X, and I don't see an uninstaller either. How can I uninstall Postgres?
Sachin_S

Senior member

Joined: 1 Aug 2008 02:37:24
Messages: 486
Offline

Hi,

There must be an uninstall-postgresql.app file in the installation directory. If it is not then your installation is broken, Though you can manually uninstall postgresql also, see http://forums.enterprisedb.com/posts/list/2128.page#10495

--
Regards,
Sachin Srivastava
EnterpriseDB , the Enterprise Postgres company.
 
Forum Index » PostgreSQL Installers for Windows, Linux and OS X
Go to:   
Powered by JForum 2.1.8 © JForum Team