Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Postgres path variable on Windows 10

I'm on a windows machine and I am having trouble fixing this error:

I've tried to modify the path variable based on various suggestions online but nothing seems to work. I've been at this for over an hour.

I'm curious what exactly I am suppose to do to have the path variable read.

I'm on Windows 10.

I think I need idiot proof step-by-step instructions.

Here is an example of one of my attempts:

enter image description here

When I run psql from the command prompt it is not recognized.

like image 667
William Avatar asked Sep 20 '16 19:09

William


People also ask

Do we need to set Environment Variables for PostgreSQL?

The use of the PostgreSQL environment variables is not required.

How do I add a variable to my path?

To add a path to the PATH environment variableIn the System dialog box, click Advanced system settings. On the Advanced tab of the System Properties dialog box, click Environment Variables. In the System Variables box of the Environment Variables dialog box, scroll to Path and select it.


2 Answers

first, you have to set the path for this go to program files search for PostgreSQL folder then a folder come click on it then you will see bin folder click on there where the arrow is pointing you will get the path like this C:\Program Files\PostgreSQL\13 copy it enter image description here

then left-click on this PC, Click on properties Click on the advance system setting on your left hand side a prompt is open then click on an environment variable enter image description here

Click on the path click on edit then click on new then paste this C:\Program Files\PostgreSQL\13 enter image description here

your environment is set then go to cmd type psql -U Postgres then type the password boom done

like image 80
kukab Avatar answered Sep 20 '22 11:09

kukab


The PATH contains directories, not the actual executable.

And programs are installed in c:\Program Files not c:\Windows\Program Files.

So you need to add c:\Program Files\PostgreSQL\9.6\bin to the path.

like image 43
a_horse_with_no_name Avatar answered Sep 16 '22 11:09

a_horse_with_no_name