在非默认的路径下创建表空间及数据库后,删除数据库目录后,还需要删除pg_tblspc下的链接文件,否则尝试启动其他实例时会报错:
如下案例中的“pg_tblspc/46885”实际链接路径为“/data/highgo/4.1.0/1”
把/data/highgo/4.1.0/1删除后,
[highgo@db1 ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export LANG=C
export PGHOME=/data/highgo/4.1.0
export PGUSER=highgo
export PGPORT=5866
export PGDATA=/data/highgo/4.1.0/data
export PATH=$PGHOME/bin:$PATH:$HOME/bin
export LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATH
启动数据库会报错:
[highgo@db1 ~]$ pg_ctl start
server starting
[highgo@db1 ~]$ ??: 00000: ?????????? 2017-07-14 11:41:46 CST
如下案例中的“pg_tblspc/46885”实际链接路径为“/data/highgo/4.1.0/1”
把/data/highgo/4.1.0/1删除后,
[highgo@db1 ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export LANG=C
export PGHOME=/data/highgo/4.1.0
export PGUSER=highgo
export PGPORT=5866
export PGDATA=/data/highgo/4.1.0/data
export PATH=$PGHOME/bin:$PATH:$HOME/bin
export LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATH
启动数据库会报错:
[highgo@db1 ~]$ pg_ctl start
server starting
[highgo@db1 ~]$ ??: 00000: ?????????? 2017-07-14 11:41:46 CST