The error you get when you type the command psql -U postgres postgres occurs because you do not have psql added to your PATH environment variable.
To fix it, click Windows > search for Edit the System Environment Variables, and open it. The System Properties window should appear. Click on Environment Variables at the bottom right > Select PATH and click on Edit. Now, click on New and add the path to the bin folder of your PostgreSQL installation (it may be similar to C:ProgramFilesPostgreSQL15bin).
Finally, close all command prompts or terminals and reopen them to effect the changes.
2
Answers
The error you get when you type the command
psql -U postgres postgres
occurs because you do not have psql added to your PATH environment variable.To fix it, click Windows > search for Edit the System Environment Variables, and open it. The System Properties window should appear. Click on Environment Variables at the bottom right > Select PATH and click on Edit. Now, click on New and add the path to the bin folder of your PostgreSQL installation (it may be similar to C:ProgramFilesPostgreSQL15bin).
Finally, close all command prompts or terminals and reopen them to effect the changes.
I hope this helps.
You need to add psql to the path environment variable as the configuration needs to be done manually.