本人的系統是虛擬機器上的Ubuntu 8.04
1.先去http://www.postgresql.org那裡下個postgreSQL core 8.3.
2.使用命令tar -xvf postgreSQL-8.3.3.tar.bz2 解壓
3.去那個解壓的檔案夾,使用./configure 命令,它將自動檢查系統配置
4.很不幸得是報了一個"c cannot output the executable file"
相關閱讀:Ubuntu下安裝PostgreSQL8.3詳細過程[多圖]
5.然後在網上找了找資料,發現沒有升級libc所以使用命令:sudo apt-get install libc6-dev gcc g++
6.再運行"./configure",卻報了readline library is not found,如果這個錯誤你能解決最好,還有可能報zlib is not found
7.不幸的是我找了2個多小時,下載了無數相關的包,最後以readline5-dev包不能正常安裝告終。
8.所以沒有辦法,只好這樣運行./configure --without-readline --without-zlib
9.然後make
10.下面命令是要加sudo的
make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
到了這裡,我們要建立logfile 檔案然後把它拷貝到 /usr/local/pgsql/data/ (好像不拷貝也可以,大家可以試試)
然後切換使用者sudo - 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
最後,你能看到sql 互動介面,大功告成。