[GIS] How to uninstall PostgreSQL Server on localhost and reinstall with new user and password

postgispostgresqlwindows 7

On Windows 7, I'd like to install a brand new, fresh installation of PostgreSQL/PostGIS on a laptop, and wipe ALL the localhost servers, users, data and passwords clean, and then reinstall as if it had never been installed before. I have QGIS 1.8.0 running perfectly, but I'd like to create a PostGIS database. However, an idle and unnecessary installation already exists that I'd like to clean off or reset the password on.

I've done an 'uninstall' of Postgis, and then PostgreSQL, but that didn't remove the network service and former postgresql user. Reinstalling requires the same password and user as before, and so I'm stuck.

If there is an easy solution, without reinstalling Windows 7 or QGIS 1.8 (osgeo4w) then I'd like to go that route. What should I do in this situation?

Best Answer

The postgres user is normally hidden under Windows 7. You can delete it only in the Command Window with

net user postgres /delete

The postgres service can be deleted with sc delete postgresql-8.3 (or whatever version you are running).

For more details on how to uninstall postgres completely, see http://forums.enterprisedb.com/posts/list/1437.page

There are some registry entries to be removed manually.