Answer a question

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 correct

I'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

Answers

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):

  1. Windows 10 and Windows 8
  2. In Search, search for and then select: System (Control Panel)
  3. Click the Advanced system settings link.
  4. Click Environment Variables.
  5. In the section System Variables, find the PATH environment variable and select it. Click Edit.
  6. If the PATH environment variable does not exist, click New.
  7. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable.
  8. Click OK.
  9. Close all remaining windows by clicking OK.
  10. 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

Logo

PostgreSQL社区为您提供最前沿的新闻资讯和知识内容

更多推荐