I have a local postgresql database for development purposes that I dont want to start up every time Windows does - how do I stop it from starting!
If it is running as a Windows service: Start -> Run -> (then type in:) services.msc. Scroll to PostgresSQL services, double click and 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.
You can check this out
Type services.msc as previously mentioned and read the path-to-executable as follows;
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.
The accepted answer didn't work for me because everything is greyed out and I can't disable anything.
If you have the same issue, it could be due to privileges.
You will need to launch CMD as an admin user:
- Open Start, type: CMD
- Right click CMD
- Click Run as administrator
Then you can disable PostgreSQL by running the following commands:
sc stop postgresql-x64-13
sc config postgresql-x64-13 start=disabled
Replace 13 with your PostgreSQL version number. You can find the service name by running:
Of course the better solution is to install Linux ;)