How to access Postgresql consoles?

Asked

Viewed 9,247 times

1

I bought it recently that book and have followed the guidelines on how to install Postgresql for the Windows operating system:

inserir a descrição da imagem aqui

I can make all possible changes to the interactive environment, but I want to have access to the console module as I’m used to.

inserir a descrição da imagem aqui

I need guidance on that.

When I clicked directly on the executable gave this error

inserir a descrição da imagem aqui

  • Open the prompt and type psql path which may vary,c:\program file (86)\postgres<versao>\bin and type psql

  • it generated an error that said it was not found even though I clicked directly on the executable file. What to do now?

  • 1

    @wladyband did not run by console?

  • executed also and gave the same error. but it exists in the indicated path.

1 answer

2

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.

propriedades do sistema

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.

inserir a descrição da imagem aqui

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

  • did not work because it until April, but at the time the user needs to enter the password it fails as if the password was wrong.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.