[root@bogon postgresql]# su - postgres [postgres@bogon ~]$ vim ~/.bash_profile # 添加: export PGHOME=/opt/postgresql export PGDATA=/opt/pgdata PATH=$PGHOME/bin:$PATH:$HOME/bin [postgres@bogon ~]$ source .bash_profile