#contents *インストール **ダウンロード -[[phpPgAdmin :: Web Based PostgreSQL Administration Tool:http://phppgadmin.sourceforge.net/]]より、最新版をダウンロードする。~ 2003/10/20現在、最新版は3.1。 **解凍・展開 ダウンロードしたファイルが/tmp以下にあるとすると、以下のようにします。 $ tar jxf /tmp/phpPgAdmin-3.1.tar.bz2 当然、HTTPサーバが読んでくれる位置です。今回は、DocumentRootで行いました。 **設定 できたディレクトリのphpPgAdmin以下にconfディレクトリがあるのでそこへ移動して、config.ini.phpを編集する。 $ cd phpPgAdmin/conf/ $ emacs config.inc.php 編集するのは、$conf['default_lang'] = 'english';という行を $conf['default_lang'] = 'japanese'; とするだけで、日本語表示になる。また、PostgreSQLが同一サーバ上以外で動いている場合は、 $conf['servers'][0]['host'] = ''; // Hostname or IP address for server. の行も適時変更する。 **レポート機能 レポート機能とは、SQL文を登録しておくといつでもそのSQL文を呼び出せるという便利な機能です。~ 機能を使うためにまずは、postgresユーザで、ユーザの作成をする。 $ su - postgres Password: $ createuser phppgadmin Shall the new user be allowed to create databases? (y/n) n Shall the new user be allowed to create more new users? (y/n) n CREATE USER 次に、用意されたSQL文を以下のように、postgresユーザで流す。このとき存在するDB名を指定しておかないとエラーになる。 $ psql -f phpPgAdmin/sql/reports-pgsql.sql www CREATE DATABASE You are now connected to database phppgadmin. psql:phpPgAdmin/sql/reports-pgsql.sql:20: NOTICE: CREATE TABLE will create implicit sequence 'ppa_reports_report_id_seq' for SERIAL column 'ppa_reports.report_id' psql:phpPgAdmin/sql/reports-pgsql.sql:20: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'ppa_reports_pkey' for table 'ppa_reports' CREATE TABLE GRANT GRANT これで準備が完了。 *確認 ブラウザで ''http://postgresサーバ/phpPgAdmin/index.php''へアクセスする。 #ref(phpPgAdmin01.png) 上記のような画面が現れたら、postgresユーザでログインすると以下のような画面が、あらわあれる。 #ref(phpPgAdmin02.png)