文書の過去の版を表示しています。
PostgreSQL
インストール
- NPO法人 日本PostgreSQLユーザ会より最新版をダウンロードしてくる。
- postgresql-x.x.x-x-windows-x64.exe を実行する。
- postgres のパスワードを設定してインストールを完了させる。
- Application Stack Builderで pgBouncer、Npgsql(.NETから利用時)、psqlODBC(MS-Accessから利用時)、PostGIS(GIS機能を利用時)をインストールする。
- 開発用に利用する場合は、[コントロール パネル] - [システムとセキュリティ] - [管理ツール] - [サービス] より以下のサービスのスタートアップの種類を手動に設定しておく。
- postgresql-x64-x.x
- pgbouncer
- pgsql_start.cmd ファイルを作成して手動起動できるようにしておく。
powershell -command start \"net\" -verb runas -argumentlist \"start postgresql-x64-x.x\" powershell -command start \"net\" -verb runas -argumentlist \"start pgbouncer\"
- pgsql_stop.cmd ファイルを作成して手動停止できるようにしておく。
powershell -command start \"net\" -verb runas -argumentlist \"stop postgresql-x64-x.x\" powershell -command start \"net\" -verb runas -argumentlist \"stop pgbouncer\"
pgBouncer の設定
- pgbouncer_edit.cmd ファイルを作成して、設定を編集できるようにしておく。
powershell -command start \"notepad\" -verb runas -argumentlist \"C:\\Program Files (x86)\\PgBouncer\\share\\pgbouncer.ini\"
- pgbouncer.ini の以下の部分を修正する。
[databases] database_name = host=localhost dbname=database_name user=user_name password=********
; any, trust, plain, crypt, md5 auth_type = any ;auth_file = 8.0/main/global/pg_auth ;auth_file = C:\Program Files (x86)\PgBouncer\etc\userlist.txt
- pgBouncer サービスを再起動して設定を反映させる。
アプリの設定
- pgBouncer を利用するには、6432 ポートを利用するように設定する。
- DB に接続できない場合は以下のログを確認する。
C:\Program Files (x86)\PgBouncer\log\pgbouncer.log
pgAdmin3 のインストール
- pgAdmin: Download - Windows ™より最新版をダウンロードしてくる。
- pgadmin3-x.xx.x.zip を解凍し pgadmin3.msi を実行してインストールする。