1 year ago

#76595

test-img

de guide

start postgres as service on windows

I am working on windows server and I want to start postgreSQL as service by the following command but it does not work. Could you tell me what is wrong ?

sc create postgresql binPath="C:\Program Files\PostgreSQL\13\bin\pg_ctl.exe" runservice -w -N "P4" -D "C:\Program Files\PostgreSQL\13\data" - start auto

UPDATE

I succedeed to create the service by running the command

pg_ctl.exe register -N PostgreSQL -D "%ProgramData%/db_data" –S auto

but when i tried to start it I have the following error message

The PostgreSQL service on local computer started and then stopped some services stop automatically if they are not in use by other services or programs

UPDATE2

One of my colleague resolved the issue. It was a per'ission issue. I hadn't the permission to start the service. The discussion is closed

windows

postgresql

service

0 Answers

Your Answer

Accepted video resources