How to start and stop PostgreSQL server?



On Windows



First, you need to find the PostgreSQL database directory, it can be something like C:\Program Files\PostgreSQL\10.4\data. Then open Command Prompt and execute this command:


pg_ctl -D "C:\Program Files\PostgreSQL\9.6\data" start

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

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



Another way:

Open Run Window by Winkey + R
Type services.msc
Search Postgres service based on version installed.
Click stop, start or restart the service option.

Comments

Popular posts from this blog

Postgresql Book References

Postgresql Tools