Postgresql -bash: psql: command not found

后端 未结 6 2089
借酒劲吻你
借酒劲吻你 2020-12-13 17:39

I have installed PostgreSQL and it is working ok. However, when I went to restore a backup I got the error -bash: psql: command not found:

 [roo         


        
6条回答
  •  攒了一身酷
    2020-12-13 18:14

    The question is for linux but I had the same issue with git bash on my Windows machine.

    My pqsql is installed here: C:\Program Files\PostgreSQL\10\bin\psql.exe

    You can add the location of psql.exe to your Path environment variable as shown in this screenshot:

    You might need to change default logging user using below command.

    psql -U postgres
    

    Here postgres is the username. Without -U, it will pick the windows loggedin user.

提交回复
热议问题