'psql' is not recognized as an internal or external command
Have you added the Postgres binaries to your path in windows? It would seem that this is a likely cause of your issue.
To add to your path follow these steps (pulled from https://www.java.com/en/download/help/path.xml -- yes I know it is java but the premise is the same):
- Windows 10 and Windows 8
- In Search, search for and then select: System (Control Panel)
- Click the Advanced system settings link.
- Click Environment Variables.
- In the section System Variables, find the PATH environment variable and select it. Click Edit.
- If the PATH environment variable does not exist, click New.
- In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable.
- Click OK.
- Close all remaining windows by clicking OK.
- Reopen Command prompt window, and run your java code. (in our case psql)
You would add the bin folder to your path rather than just an individual binary. For reference also see this question: How to set Postgres path variable on Windows 10
Related videos on Youtube
X-x
Updated on June 04, 2022Comments
-
X-x almost 2 years
I have installed postgresql 10 on my windows 10 and added those paths
(C:\Program Files\PostgreSQL\10\bin) , (C:\Program Files\PostgreSQL\10\lib)
but when i go to the CMD under administration rights and test PSQL or psql --version ... i still get the same error
'psql' is not recognized as an internal or external command
i tried
echo %path%
and i can see the path there correctI'm actually trying to link Flask to Heroku database that is why i have installed Postgresql so the pc can be familiar with psql commands
-
X-x over 5 yearsthanks a lot for replying but as i stated above that's exactly what i did and it didnt work :S , i closed the CMD port twice and reopened it with admin right
-
hgoscenski over 5 yearsCan you show your path? Also can you execute via a fully defined path?
-
X-x over 5 yearsi dont know what do you mean by ( fully defined path ) but here is the image from my pc and the path is correct .... tinypic.com/view.php?pic=2mg2gcl&s=9#.W5gON-gzZPY
-
hgoscenski over 5 yearsYou need to add bin
-
X-x over 5 yearsyea i have just noticed but i have added it as well and it didnt work , now i have all of them added , bin , script and lib
-
hgoscenski over 5 yearsI assume you closed and reopened all cmd windows?
-
X-x over 5 yearsyea i think it worked but only on admin rights ! , thanks alot man
-
hgoscenski over 5 yearsAwesome! I am glad to hear that, if you think my answer helped I would appreciate you accepting it, otherwise I wish you the best of luck.