Getting psql Utility on Windows CLI

I recently had to connect to a Postgres database on the network to perform some simple administrative tasks. However, the Windows machine I had did not have Postgres installed.

As I only needed the “psql” utility to connect and query the database, and not the entire database engine, I was reluctant to install Postgres on the machine. I contemplated of installing other graphical clients, but it was still too heavy for such a simple task I needed to do.

So what better solution than to use the official psql utility instead?

I downloaded a zip archive of all the Postgres binaries from the official website. From there, I extracted the “bin” folder onto my local file system, and added its absolute path to the “Path” variable under the Windows User/System Variables.

A quick restart of the command prompt proved that I had psql installed! Using the –help flag showed me all the possible options and variables I could use with the utility.

Problem solved 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s