Google News
logo
PostgreSQL - Interview Questions
How can you start, stop, and restart the PostgreSQL server on Windows?
To start, stop, and restart the PostgreSQL server on Windows, first, we have to find the PostgreSQL database directory. It would look something like this : C:\Program Files\PostgreSQL\10.4\data. Now, open the Command Prompt and execute the following commands :
 
To start the PostgreSQL server of Windows :
pg_ctl -D "C:\Program Files\PostgreSQL\9.6\data" start  

To stop the PostgreSQL server of Windows :
pg_ctl -D "C:\Program Files\PostgreSQL\9.6\data" stop​
  
To restart the PostgreSQL server of Windows :
pg_ctl -D "C:\Program Files\PostgreSQL\9.6\data" restart  

Another way to start, stop and restart the PostgreSQL server on Windows.
 
There is also another way to start, stop, and restart the PostgreSQL server on Windows. Follow the steps given below:
 
* First, open the Run Window by pressing the Windows key + R simultaneously.
* Then, type services.msc to find out the PostgreSQL services.
* Search Postgres service based on the version installed.
* Click the stop, start or restart option to do the same.
Advertisement