諸事情により、PostgreSQL最新版に興味を持ち始めたので早速テストサーバ(Redhat9)にインストール。
以下、インストールログをずらずらと。
今まで利用していたapt-get管理のPostgreSQL7をremoveする。
$ sudo apt-get remove postgresql
$ sudo apt-get remove postgresql-devel
$ sudo apt-get remove postgresql-libs
PostgreSQL公式サイトより「postgresql-8.0.3.tar.bz2」をダウンロード。そしてインストール開始。
$ bzip2 -dc ./postgresql-8.0.3.tar.bz2 | tar xvf –
$ cd postgresql-8.0.3
$ ./configure
$ make CC=gcc CFLAGS=”-O3″ | tee makelog.001
All of PostgreSQL successfully made. Ready to install.
$ make check
$ sudo make install
PostgreSQL installation complete.
$ sudo /usr/sbin/adduser postgres
$ sudo mkdir /usr/local/pgsql/data
$ sudo chown postgres.postgres /usr/local/pgsql/data/
$ sudo su – postgres
$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
WARNING: enabling “trust” authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
Success. You can now start the database server using:
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
or
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
$ vi ~/.bash_profile
export 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
export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH”:”$PGLIB”
$ source ~/.bash_profile
$ pg_ctl start
$ createuser xyz
$ vi /usr/local/pgsql/data/postgresql.conf
listen_addresses = ‘xxx.xxx.xxx.xxx’
$ vi /usr/local/pgsql/data/pg_hba.conf
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# “local” is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
host all all xxx.xxx.xxx.xxx/32 trust
host all all yyy.yyy.yyy.yyy/32 trust
$ /usr/local/pgsql/bin/pg_ctl stop
$ /usr/local/pgsql/bin/pg_ctl start
$ exit
$ psql -l
List of databases
Name | Owner | Encoding
———–+———-+———-
template0 | postgres | EUC_JP
template1 | postgres | EUC_JP
(4 rows)
参照情報
PostgreSQL 8.0.xのインストール
PostgerSQL 8.0.2 on Vine 3.1 インストールのメモ
Popular Posts:
- None Found