PostgreSQL -bash:psql:找不到命令 [英] Postgresql -bash: psql: command not found

查看:1646
本文介绍了PostgreSQL -bash:psql:找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了PostgreSQL,它可以正常工作.但是,当我还原备份时,出现错误-bash: psql: command not found:

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:

 [root@server1 ~]# su postgres
 [postgres@server1 root]$ psql -f all.sql
 bash: psql: command not found
 [postgres@server1 root]$ 

我做错了什么?

推荐答案

psql可能不在postgres用户的PATH中.使用 locate 命令查找psql的位置,并确保其路径在PATH中postgres用户.

perhaps psql isn't in the PATH of the postgres user. Use the locate command to find where psql is and ensure that it's path is in the PATH for the postgres user.

这篇关于PostgreSQL -bash:psql:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆