how to set up the psql command in cygwin?

chaonextdoor picture chaonextdoor · Jan 23, 2013 · Viewed 11.2k times · Source

I have a local dev site on my machine with Apache server and PostgreSQL 9.1 database. As I'm using Windows, I also installed Cygwin. I want to access to database and make some queries via Cygwin insead of pgAdmin III, but it tells me that psql command not found. How should I set up the psql command in cygwin?

Answer

Cao Minh Tu picture Cao Minh Tu · Jan 11, 2017

As of today, you just have to install postgresql-client package in cygwin:

  • Run your cygwin setup.exe file (this can be run multiple times to add more packages).
  • Type postgresql into the search box, select postgresql-client and press "next" to install.

enter image description here

Now you can open Cygwin terminal and type psql to run!

enter image description here