- 1 year ago
getting message "psql is not recognized as an internal or external command"
The error message "psql is not recognized as an internal or external command" typically indicates that the psql
command-line tool is not recognized by the system's command prompt or shell. Here are a few steps you can take to resolve this issue:
Verify PostgreSQL installation: Ensure that PostgreSQL is properly installed on your system. Check the installation directory and verify that the
bin
directory, which contains thepsql
executable, is included in the system'sPATH
environment variable. If PostgreSQL is not installed, you can download and install it from the official PostgreSQL website.Add PostgreSQL
bin
directory to thePATH
:- Open the System Properties dialog by right-clicking on "This PC" or "My Computer" and selecting "Properties".
- Click on "Advanced system settings" (or "Advanced" -> "Environment Variables" on older versions of Windows).
- In the System Variables section, find the
PATH
variable and click "Edit". - Add the path to the PostgreSQL
bin
directory (e.g.,C:\Program Files\PostgreSQL\13\bin
) at the end of the variable value. Make sure to separate it from the previous entry with a semicolon (;
). - Click "OK" to save the changes.
Restart the command prompt or shell: After modifying the
PATH
environment variable, close and reopen the command prompt or shell. This ensures that the updatedPATH
takes effect.Verify
psql
recognition: Open a new command prompt or shell and typepsql
. If the installation andPATH
configuration are correct, thepsql
command should be recognized, and you should see the PostgreSQL command prompt.
By following these steps, you should be able to resolve the "psql is not recognized" error and use the psql
command-line tool successfully.