*postgres7.4.x+Perl Moduleのインストール [#qd46c569]

RIGHT:更新日&lastmod();  

[[ここ:http://www.postgresql.org/]]からPostgresqlを、 [[ここhttp://cpan.uwinnipeg.ca/htdocs/faqs/cpan-search.html?request=search]]からPerl Module(pgsql_perl5-1.9.0.tar.gz)をDownloadする。
**postgres7.4.xのインストール [#b21ca4d5]

事前にpostgresというユーザを作成。

vine3.0ではreadline-devel-4.3-5vl1.i386.rpmがインストールされていないで
インストールする

 $ tar zxvf postgresql-7.4.1.tar.gz
 $ cd postgresql-7.4.1
 $ ./configure --enable-multibyte=EUC_JP --enable-syslog --with-perl \
 --with-openssl <-sslを有効にする
 $ make
 $ su
 # make install
 # chown -R postgres.postgres /usr/local/pgsql

postgresの.bash_profileに

     # PostgreQSL
     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

     $ initdb

     $ cd /usr/local/pgsql/data
     $ chmod 600 pg_hba.conf

pg_hba.confを編集
 # TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
 
 host       yotei      www            192.244.75.xxx  255.255.255.248    trust
 host       yotei      www            192.244.75.xxx  255.255.255.255    trust
 host       yotei      all            10.3.1.xxx      255.255.255.255    trust
 host       yotei      all            0.0.0.0         0.0.0.0            reject
  
 
 host       all        all            127.0.0.1       255.255.255.255    trust

 logを取るために

  postgresql.confで

   #log_connections = false
   log_connections = true
   #log_timestamp = false
   log_timestamp = true

に変更する。Logファイルははじめに以下のように作成しておく。

 # touch /var/log/postgresql.log
 # chown postgres.postgres /var/log/postgresql.log
 # chmod o-r /var/log/postgresql.log

またネットワークで使用する場合以下の設定も必要かも
 
postgresql.confで
 #tcpip_socket = false
 を
 tcpip_socket = true

**起動 [#lb2c4990]
 $ pg_ctl -w start
 	または、
 $ /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data >/var/log/postgresql.log 2>&1 &

このとき/tmp/.sPGSQL.5432 があると起動しないので消しておく

また、

/usr/local/pgsql/data/postmaster.pid

も削除しておく。

**Perl Moduleのインストール [#k9fd989d]
モジュールのコンパイルはpostgresユーザで行う。

このときPostgreSQLが動作している必要がある。でないと

make testでエラーする。

 $ tar zxvf pgsql_perl5-1.9.0.tar.gz
 $ cd pgsql_perl5-1.9.0
 $ perl Makefile.PL
 $ make
 $ make test

ところが、このバージョンでは

 PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.6.1/ i386-linux -I/usr/lib/perl5/5.6.1 test.pl
 Can't call method "errorMessage" on an undefined value at test.pl line 99.
 make: *** [test_dynamic] エラー 255

のようなエラーが出たので

test.plを修正

99行目あたり

 #( $$Option_ref{port} ne "" && $$Option_ref{dbname} ne "" && $$Option_ref{user} ne "" ) <---コメントアウト

 ( $$Option_ref{port} ne "" && $$Option_ref{dbname} eq "" && $$Option_ref{user} ne "" )  <---追加
     and print "Pg::conndefaults ........ ok\n"
     or  die   "Pg::conndefaults ........ not ok: "; #, $conn->errorMessage;
                                                  ^^^^<---追加

119行目あたり
 #( $conn->errorMessage =~ /Database .?rumpumpel.? does not exist/ ) <---コメントアウト
 ( $conn->errorMessage =~ 'FATAL:  database "rumpumpel" does not exist' ) <---追加


再度 $ make test

 PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.6.1/i386-linux -I/usr/lib/perl5/5.6.1 test.pl
 Pg::conndefaults ........ ok
 Pg::connectdb ........... ok
 $conn->exec ............. ok
 $conn->errorMessage ..... ok
 $conn->db ............... ok
 $conn->user ............. ok
 $conn->port ............. ok
 $conn->cmdStatus ........ not ok: CREATE TABLE
 $conn->oidStatus ........ ok
 $conn->getline .......... ok
 $conn->endcopy .......... ok
 $result->cmdTuples ...... ok
 $result->fname .......... ok
 $result->ftype .......... ok
 $result->fsize .......... ok
 $result->fnumber ........ ok
 $result->fetchrow ....... ok
 test sequence finished.
 
 $ su
 # make install

					DE JE2ISM      2004/02
細かいPostgresqlの設定は[[ここ:https://wwwism.dyndns.org/hp/linux/postgres.htm]]にある。

--------------------------------------------------------------------------------
RIGHT:[[元ページ:https://wwwism.dyndns.org/hp/linux/coimap.htm]]

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS