root用户不能使用psql或者pg_dump等pg命令
[[email protected] html]# ./getdata.sh
./getdata.sh: line 6: psql: command not found
[[email protected] html]# vi getdata.sh
[[email protected] html]# psql -U postgres
-bash: psql: command not found
[[email protected] html]# find / -name "psql"
/home/pgsql/9.1/bin/psql
[[email protected] html]# ln -s /home/pgsql/9.1/bin/psql /usr/sbin/psql 做一个软链接即可
root用户不能使用pg_dump
[[email protected] bk_pg]# cat bk.log
./backup.sh: line 20: pg_dump: command not found
[[email protected] html]# ln -s /home/pgsql/9.1/bin/pg_dump /usr/sbin/pg_dump 即可