Friday 4 May 2012

How to remove PostgreSQL in Windows machine

These steps i found in one of the forums , and is very useful.

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) 

I like Revo uninstaller the best, it removes and invokes built in uninstaller tool, clear  all registry settings. But for the postgres user, we need to delete it manually only as above.