You are getting the error:
'psql' is not recognized as an internal or external command,
operable program or batch file.
This means PostgreSQL’s bin folder is not added to the Windows PATH, or PostgreSQL/psql is not installed.
Let’s fix it.


Find the PostgreSQL installation folder Normally located at:
C:\Program Files\PostgreSQL\16\bin
(or version 15/14 depending on your install)
Copy the bin folder path Example:
C:\Program Files\PostgreSQL\16\bin
Add to Windows PATH
C:\Program Files\PostgreSQL\16\bin)Restart Command Prompt
Test again:
psql --version
You should now see something like:
psql (PostgreSQL) 16.x
If you cannot find the folder:
Make sure psql is selected during installation.
Many users install pgAdmin 4 only, not PostgreSQL itself. pgAdmin does not include psql.
In that case, reinstall PostgreSQL using the official installer.