windows:postgresql

文書の過去の版を表示しています。


PostgreSQL

  1. NPO法人 日本PostgreSQLユーザ会より最新版をダウンロードしてくる。
    ここでは postgresql-11.4-3-windows-x64.exe をダウンロードする。
  2. postgresql-x.x.x-windows-x64.exe を実行する。
  3. [Next >] ボタンをクリックしてインストールを続ける。
    PostgreSQL Installer 001PostgreSQL Installer 002
    PostgreSQL Installer 003PostgreSQL Installer 004
  4. postgres のパスワードを設定して [Next >] ボタンをクリックしインストールを続ける。
    PostgreSQL Installer 005PostgreSQL Installer 006
    PostgreSQL Installer 007PostgreSQL Installer 008
    PostgreSQL Installer 009PostgreSQL Installer 010
  5. [Finish] をクリックすると Application Stack Builder が起動する。
    PostgreSQL Installer 011
  6. Application Stack Builder で pgBouncer、Npgsql(.NETから利用時)、psqlODBC(MS-Accessから利用時)、PostGIS(GIS機能を利用時)をインストールする。
    [次へ >] をクリックし、リストから PostgreSQL 11 (x64) on port 5432 を選択して [次へ >] でインストールを進める。
    Application Stack Builder 001Application Stack Builder 002
  7. インストールしたいアプリケーションを選択する。
    [v] pgBouncer
    [v] Npgsql
    [v] psqlODBC (64bit)
    [v] PostGIS


    Application Stack Builder 003Application Stack Builder 004

  8. [次へ >] をクリックすると必要なアプリケーションのダウンロードが開始される。Application Stack Builder 005Application Stack Builder 006
  9. 全てのダウンロードが完了したら [次へ >] でアプリケーションのインストールを開始する。
    Application Stack Builder 007
    1. Npgsql インストーラーの [Next >] クリックしてインストールを行う。
      Npgsql Installer 001Npgsql Installer 002
      Npgsql Installer 003Npgsql Installer 004
    2. pgBouncer インストーラーの [Next >] クリックしてインストールを行う。
      pgBouncer Installer 001pgBouncer Installer 002
      pgBouncer Installer 003pgBouncer Installer 004
      pgBouncer Installer 005pgBouncer Installer 006
      pgBouncer Installer 007
    3. PostGIS インストーラーの [Next >] クリックしてインストールを行う。
      PostGIS Installer 001PostGIS Installer 002
      PostGIS Installer 003PostGIS Installer 004
      PostGIS Installer 005PostGIS Installer 006
      PostGIS Installer 007
  10. 全てのインストールが完了したら Application Stack Builder を終了する。
    Application Stack Builder 008
  11. 開発用に利用する場合は、[コントロール パネル] - [システムとセキュリティ] - [管理ツール] - [サービス] より以下のサービスのスタートアップの種類を手動に設定しておく。
    • postgresql-x64-x.x
    • pgbouncer
  12. pgsql_start.cmd ファイルを作成して手動起動できるようにしておく。
    pgsql_start.cmd
    powershell -command start \"net\" -verb runas -argumentlist \"start postgresql-x64-x.x\"
    powershell -command start \"net\" -verb runas -argumentlist \"start pgbouncer\"
  13. pgsql_stop.cmd ファイルを作成して手動停止できるようにしておく。
    pgsql_stop.cmd
    powershell -command start \"net\" -verb runas -argumentlist \"stop postgresql-x64-x.x\"
    powershell -command start \"net\" -verb runas -argumentlist \"stop pgbouncer\"
  1. pgbouncer_edit.cmd ファイルを作成して、設定を編集できるようにしておく。
    powershell -command start \"notepad\" -verb runas -argumentlist \"C:\\Program Files (x86)\\PgBouncer\\share\\pgbouncer.ini\"
  2. 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
  3. pgBouncer サービスを再起動して設定を反映させる。
  1. pgBouncer を利用するには、6432 ポートを利用するように設定する。
  2. DB に接続できない場合は以下のログを確認する。
    C:\Program Files (x86)\PgBouncer\log\pgbouncer.log
  1. pgAdmin: Download - Windows ™より最新版をダウンロードしてくる。
  2. pgadmin3-x.xx.x.zip を解凍し pgadmin3.msi を実行してインストールする。
  • windows/postgresql.1564443656.txt.gz
  • 最終更新: 2019/07/30 08:40
  • by ともやん