Setting Windows PATH for Postgres tools

If, after installing PostgreSQL, you face “psql not recognized as an internal or external command” error when you try to run psql from command prompt, then most probably all you need to do to solve this problem is to add the 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.

Step 2. Start typing “environ…” in the Windows Search Textbox and choose “Edit the system environment variables” option at the “Best match” list.
Step 3. The “System Properties” window will be opened where the tabs like “Computer Name,” “Hardware,” and other advanced properties can be founded.

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.

Step 6. Click on the “New” button and type a new path, like C:\Program Files\PostgreSQL\11\bin\ into a new editable row.
Step 7. Click “OK” to save the new PATH variable. But in order to these changes has an effect on your Command Prompt window you need to reopen it.