If, after installing PostgreSQL, you face “psql not recognized as an internal or external command” error when you try to run psql from the command prompt, then most probably all you need to do to solve this problem is to add Postgres’s bin directory to the PATH system variable (the PATH is a system variable which allows Windows with the help of the Command prompt or the Terminal window find executables).
In this blog post, we’ll share seven simple steps that describe how to add the folder to the Windows 10 PATH variable.
Step 1. Run Windows Search on your Windows 10 machine by pressing WIN+S. You will see the Search Textbox.
Go to the “Advanced” tab and click on the “Environment Variables” button at the bottom. The “Performance,” “User Profiles,” and “Startup and Recovery” options can also be set in this tab.
Step 4. The “Environment Variables” window will be opened. This is divided into two boxes with User variables and System variables – where all variables and their values are displayed.
Find the “Path” variables in the System variables box, as shown in the screenshot above.
Step 5. Double click on the “Path” variable.
The list with all Path variables will be opened, where the Path variables can be edited, added, and deleted.