Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open postgres command Line?

I have postgres installed.How to open postgres command Line? When i open command prompt, i have

Microsoft Windows [Version 10.0.17134.590]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\dhanr>

How to navigate to postgres command Line, as my final goal is to run pg_dump dbname > outfile command.

like image 613
Dhanraj Avatar asked Apr 17 '26 02:04

Dhanraj


2 Answers

You should use psql command-line tool.

You can find psql at your installation directory. Example;

C:\Program Files\PostgreSQL\10\bin\psql.exe
like image 113
grep Avatar answered Apr 18 '26 15:04

grep


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 "" 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.

like image 40
Zaynul Abadin Tuhin Avatar answered Apr 18 '26 17:04

Zaynul Abadin Tuhin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!