分类: LINUX
2011-05-13 14:26:43
http://hi.baidu.com/wangpeng1314/blog/item/89db493df6ffeecb9e3d6274.html
http://my.chinaunix.net/space.php?uid=22785134&do=blog&id=294832
解压缩 tar zxf
./configure
make clean;make
make check
make install
mkdir /usr/local/pgsql/data
useradd postgre
chown -R postgre.postgre /usr/local/pgsql
接着
vi ~postgre/.bash_profile
加上以下几句话
PGLIB=/usr/local/pgsql/lib
PGDATA=$HOME/data
PATH=$PATH:/usr/local/pgsql/bin
MANPATH=$MANPATH:/usr/local/pgsql/man
export PGLIB PGDATA PATH MANPATH
echo $PATH
再接着
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
\q是退出
dropdb test
因为之前修改过PATH 所以执行档前面不用加路径,通过PATH会找到。此外,还可以参考解压缩后的INSTALL文件、鸟哥的私房菜和以下网络文章http://www.cnblogs.com/matildawaltzer/archive/2006/11/20/566009.html
http://www.cnblogs.com/Phenix_Yang/archive/2010/11/19/1881958.html