Stop PostgreSQL from starting on Windows?

Solution 1:

If it is running as a Windows service: Start -> Run -> (then type in:) services.msc. When you see PostgresSQL services set them to manual instead of automatic. If you do need them again, just fire up services.msc again and click the Start icon/button once you have reselected the PostgresSQL service.

Solution 2:

You can check this out

Type services.msc as previously mentioned and read the path-to-executable as follows;

Services.msc capture

Path to executable: "C:\Program Files\PostgreSQL\9.3\bin\pg_ctl.exe" runservice -N "postgresql-x64-9.3" -D "C:/Program Files/PostgreSQL/9.3/data" -w

Net service name is defined as postgresql-x64-9.3

So simply, whenever I want to shut down postgresql, I just type the following on a command line instance (to create a cmd instance, type windows+r and enter cmd);

net stop postgresql-x64-9.3

If you run another version of postgresql, you can just check the service name as explained and use this as a shortcut. Hope that it helps.