You need to call psql by the prompt otherwise a black screen will appear and disappear.
To not enter this long path create an environment variable in windows and add the executable path so psql will be available at the prompt without having to be in the postgres folder.
1 - Right click on (my)computer > properties > advanced settings
2 - In the advanced tab click on environment variables, in the tab variáveis do sistema
click on new.
3 - click on novo
of the name of pg_home
and pass the path of the postgres bin folder.
4 - Still in the guide variáveis do sistema
look for path
click edit put the cursor at the end and type: ;%pg_home%
. The dot and virgular is the path separator in windows.
5 - Open a new prompt and type psql
should work.
At the prompt type:
psql -U usuario -d database
Then enter the user’s password and enter any queries you need.
Documentation of psql parameters
Open the prompt and type psql path which may vary,
c:\program file (86)\postgres<versao>\bin
and typepsql
– rray
it generated an error that said it was not found even though I clicked directly on the executable file. What to do now?
– wladyband
@wladyband did not run by console?
– gmsantos
executed also and gave the same error. but it exists in the indicated path.
– wladyband