linux - 须藤: psql: command not found: can't fix it

标签 linux postgresql ubuntu-16.04 psql postgresql-9.5

当我运行时

sudo -u postgres psql

我明白了

sudo: psql: command not found

错误。我无法让它工作。

# locate psql
/etc/alternatives/psql.1.gz
/usr/bin/psql
/usr/lib/postgresql/9.5/bin/psql
/usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
/var/lib/dpkg/alternatives/psql.1.gz
/var/lib/postgresql/.psql_history

# ln -s /usr/lib/postgresql/9.5/bin/psql /usr/bin/psql
ln: failed to create symbolic link '/usr/bin/psql': File exists

没用。不过,Postgresql 正在运行并且运行良好。

最佳答案

.bash_profile 中设置 postgres' PATH 变量以包含 /usr/lib/postgresql/9.5/bin

关于linux - 须藤: psql: command not found: can't fix it,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59221181/

相关文章:

linux - 将私钥存储在数字签名服务器上的什么位置?

c++ - QT Creator - 在我自己的库中使用外部库

linux - 如何在我的服务器中安装 phantom.js

database - 什么是数据类型 bytea,我什么时候使用它?

postgresql - Netbeans 中的远程数据库连接设置

java - Selenium - 在同一字段中输入的文本,即使打算在不同的字段中输入

php - 仅为 PHP7.1 安装 Xdebug 扩展

linux - 删除具有相似名称的文件,除了一个?

sql - 在 PostgreSQL 12 上按 id(唯一)分组的一个查询中同时获取房间成员、房间所有者和管理员

c++ - Gnu 科学图书馆在 Ubuntu 16.04 中停止工作