How to put the PostgreSQL / bin directory on my path in Windows?

I have a pretty simple question, I think. I am working on a Ruby on Rails application. I am trying to switch to PostgreSQL thanks to Heroku.

My database.yml file says:

Install PostgreSQL and put its /bin directory on your path. 

My question is, how can I put the PostgreSQL / bin directory in my path? Which file can I change and how?

I assume this is my problem, because when I run the "rails db" command, I get:

"Could not find database client: psql, psql.exe. Check your $ PATH and try again."

Thanks everyone! Robin.

+1
source share
4 answers

Add the directory to the PATH system (not the PATH user) using environment variables, using a semicolon to separate it from the previous record.

You can find it from the control panel → system → Advanced → Environment variables

+3
source

Go to the same problem and try the solution mentioned here

 [ user@host user]$ psql bash: psql: command not found [ user@host user]$ echo $PATH /bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin [ user@host user]$ export PATH=$PATH:/usr/local/pgsql/bin [ user@host user]$ psql testdb 

Gotta do the trick.

+1
source

You need to install Postgres first, then add the path to the system properties> environment variables> in the system variables section, you will see the PATH variable

0
source

This is my preferred way to add new space to the PATH environment variable (on modern Red Hat based systems):

 echo 'export PATH="/usr/pgsql-9.3/bin:$PATH"' | sudo tee /etc/profile.d/pgsql.sh 
  • PATH is a colon : divided list of directories, search in order for the called program.
  • The profile configurations in the /etc section are permanent for all users (but require activation of the active shell for source ).
  • The version number is bound to the PostgreSQL directory when it is installed from its repository .
0
source

All Articles