SSブログ
PostgreSQL ブログトップ
前の2件 | -

PostgreSQLのインストール@Vine Linux4.2 [PostgreSQL]

いい加減何度もインストールしてるのに、一向に覚えずにいつもいろんなサイトを参考にしているのでまとめてみた。
メイクしてインストールする。(ソースが/usrlocal/srcにおかれていると仮定)
$ cd /usr/local/src/postgresql-8.3.4
$ ./configure
$ make all
$ su - root
# install

PostgreSQL用のユーザを用意して、そのユーザにすべて渡す
# adduser postgres
# chown -R postgres:postgres /usr/local/pgsql

パスの設定と環境変数の設定
bashを使っているなら、.bashrcあたりに以下を追加
# su - postgres
$ vi ~/.bashrc
 PATH="$PATH":/usr/local/pgsql/bin
 export POSTGRES_HOME=/usr/local/pgsql
 export PGLIB=$POSTGRES_HOME/lib
 export PGDATA=$POSTGRES_HOME/data
 export MANPATH="$MANPATH":$POSTGRES_HOME/man
$ source ~/.bashrc

データベースクラスタの初期化
(--no-localeをつけておかないと、日本語のソートがエライことになるので、いつもつけてるけどまだいるのかな?データベースを作るときのデフォルトはEUC_JPにしておいて、必要なときはデータベース作成時に変更することにしています)
$ initdb --no-locale --encoding=EUC_JP

最後に動作することを確認する。
$ pg_ctl -D /usr/local/pgsql/data start
$ pg_ctl -D /usr/local/pgsql/data stop

システム起動時に自動起動させたい場合は http://tamatamablog.blog.so-net.ne.jp/2007-04-08 を参照



PostgreSQL configure時のエラー@Vine Linux4.2 [PostgreSQL]

インストールしたてのVine Linuxの場合、readLineとZlibの開発環境が入ってなくて、configureのときに下のようなエラーが出ちゃうので、事前にaptとかでreadline-develとzlib-develのパッケージを入れておきましょう。

readline-develが入ってないときのエラー
configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.

zlib-develが入ってないときのエラー
configure: error: zlib library not found
If you have zlib already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-zlib to disable zlib support.

aptでreadline-develとzlib-develのパッケージをインストール
# apt-get install readline-devel
# apt-get install zlib-devel


前の2件 | - PostgreSQL ブログトップ

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。