Being Windows, by your comment, after downloading via https://www.postgresql.org/download/windows/ and install, if the installer did not generate the path in the PATH (environment variables) of Windows then you have to do it manually, look for the path where you installed Postgresql, examples:
C:\Programs and Files\PostgreSQL\12\
Or something like:
C:\Bancos\PostgreSQL\12\
In case I use version 12, depending on the version will only change the folder name, then add "bin", getting:
C:\Programs and Files\PostgreSQL\12\
This is if you have installed in Programs and Files
if it is another place it is obvious that you should not copy what is above, it is only to have an idea, it will be like this:
C:\Programs and Files\PostgreSQL\12\bin
Then copy this path and go on environment variables from Windows, go to Computer/
My Computer inside the explorer:
Click on estates to open the System and in the system click on Advanced system settings
In the window system properties click on environment variables
At the bottom on environment variables look for Path and double-click the mouse, or select and go to edit button:
When opening the window click on new
Then paste the path from where your postgresql+bin is installed (example: C:\Programs and Files\PostgreSQL\12\bin
)
After this done log out and log in or restart Windows (I think you do not need, at least here I just close the cmd or similar).
Ready, pgsql will be available via cli
This depends on your operating system.
– Danizavtz
What is your operating system? Which installer you used?
– anonimo
use Windows, and I downloaded what had on the site postgre, downloaded by enterprisedb
– eduardo_ehsc
The Enterprisedb installer should have installed psql.
– anonimo
@anonimo that of the official website also, but here although there was for some reason not created the Path, the program is there... I had not noticed that it was the enterprisedb, but I believe it may be conflict with an earlier version installed
– Guilherme Nascimento