Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I start PostgreSQL on Windows?

Tags:

postgresql

I have installed Postgresql on my Windows 10 PC. I have used the pgAdmin II tool to create a database called company, and now I want to start the database server running. I cannot figure out how to do this. I have run the start command on the postgres command line, and nothing seems to happen.

What I doing is:

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

.....-> I am seeing nothing returned.

like image 496
Sean Avatar asked Apr 14 '16 17:04

Sean


People also ask

Can I use postgres on Windows?

PostgreSQL was developed for UNIX-like platforms, however, it was designed to be portable. It means that PostgreSQL can also run on other platforms such as macOS, Solaris, and Windows. Since version 8.0, PostgreSQL offers an installer for Windows systems that makes the installation process easier and faster.


1 Answers

Go inside bin folder in C drive where Postgres is installed. run following command in git bash or Command prompt:

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

Ex:

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

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

Thanks

like image 87
Santosh Patel Avatar answered Oct 12 '22 14:10

Santosh Patel