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/05/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/09/2008 18:50:54

Dave_P

Senior member
[Avatar]

Joined: 26/09/2005 12:09:59
Messages: 138
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/05/2005 19:32:21
Messages: 1
Offline

How is an uninstall achieved on OS X?
Sachin_S

Senior member

Joined: 01/08/2008 02:37:24
Messages: 254
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/05/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: 01/08/2008 02:37:24
Messages: 254
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/05/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/05/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: 01/08/2008 02:37:24
Messages: 254
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/05/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/05/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: 01/08/2008 02:37:24
Messages: 254
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/05/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 01/06/2009 19:24:21

Sachin_S

Senior member

Joined: 01/08/2008 02:37:24
Messages: 254
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/05/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
 
Forum Index » PostgreSQL Installers for Windows, Linux and OS X
Go to:   
Powered by JForum 2.1.8 © JForum Team