PostgreSQL默认数据文件地址为/var/lib/pgsql/*,修改步骤如下:

  1. Create new dir, here is /Alkheme/pgsql
  2. Change own to postgres:postgres. "chown -R postgres:postgres pgsql/"
  3. su postgres and initial data dir "initdb /Alkheme/pgsql"
  4. Change lines in file /etc/init.d/postgres 

"PGDATA=/Alkheme/pgsql/

PGLOG=/Alkheme/pgsql/pgstartup.log

"