Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (6.1k points)

I had installed the Postgresql on my Windows 10 Operating System. I had created a database called "company" using the pgAdmin II tool, and now I need to start the database server running. I don't know how to do this. I had run the start command on the Postgres command line, and nothing seems to happen.

What I am doing is:

postgres=# pg_ctl start
postgres=# pg_ctl status
postgres=# pg_ctl restart
postgres=# pg_ctl start company
postgres=# pg_ctl status

But I see nothing gets returned. 

1 Answer

0 votes
by (12.7k points)
edited by

Go the Postgres Installation directory(where Postgres is installed) and open the bin folder. Run the following command in git bash or in the Command prompt:

pg_ctl.exe restart -D "<path upto data>"

For example,

pg_ctl.exe restart -D  "C:\Program Files\PostgreSQL\9.6\data"

Alternative way is: type "services.msc" in run popup(press windows + R). This will show all services which are running. Select Postgres service from the list and click on start/stop/restart.

Check below image.

enter image description here

Interested in SQLCheck out this SQL server certification by Intellipaat.

Browse Categories

...