I recently was tricked into running one of those registry cleaner programs (RegistryBooster).

It seemed to work fine until I tried to start my postgres service.

For some reason, the 'path to executable' was no longer set on the service properties page, and obviously would not start without a path.

How can I either fix the existing service or uninstall/ re-install just the service without re-installing postgres altogether?

postgres 8.4 windows xp sp3

EDIT: in trying to fix this, i've accidentally removed the service altogether. so the question becomes: how do i re-install the service without re-installing the whole of postgres?

thanks again...


Try add/change key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\pgsql-8.4\ImagePath" in registry(change version and data dir):

"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl.exe" runservice -w -N "pgsql-8.4" -D "C:\Program Files\PostgreSQL\8.4\data\"

or run command: "C:\Program Files\PostgreSQL\8.4\bin\pg_ctl.exe" runservice -w -N "pgsql-8.4" -D "C:\Program Files\PostgreSQL\8.4\data\"

If not help, you will need to reinstall PostgreSQL.

| improve this answer | |
  • sorry, please see edit: i've actually deleted the service trying to resolve the issue... – pstanton Feb 7 '11 at 7:59
  • ah, i sorted it.. having deleted the service, i changed your command from runservice to register .. the service is created and works fine :) thx. – pstanton Feb 7 '11 at 8:02

I've had two different installs of PostgreSQL where the service has eventually spontaneously stopped working, I think due to permissions issues after a major Windows update (and definitely not due to a registry cleaner!).

But anyway, I thought it was worth flagging up that what @pstanton's says in the comment to @alvosu's answer is really a better answer, namely:

To remove the service:

pg_ctl unregister -N "PostgreSQL 9.6 Server"

(use the short name that your service actually has)

then to reinstall it

pg_ctl register -N "PostgreSQL 9.6 Server"

You need to add the flag -D "C:\Program Files\PostgreSQL\data\pg96" (or whatever the correct path is) to the register command if you do not have the PGDATA environment variable set.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.