pgenv2

動作要件

インストール

$ git clone https://github.com/moritetu/pgenv2.git
$ cd pgenv2
$ source install.sh

使用方法

利用可能なバージョンを表示

$ pgenv versions

インストール

$ pgenv install 10.4
# 11.1をdebugでインストール、ソースやインストール先は11.1debugとする
$ pgenv install --alias 11.1debug --debug --g3 11.1

デフォルト使用を10,4にする

$ pgenv global 10.4

クラスタ

クラスタ作成

$ pgenv cluster -D clusterdir -s standby primary

クラスタ停止

$ pgenv cluster -D clusterdir stop -a

クラスタ起動

$ pgenv cluster -D clusterdir start -a

クラスタ状態表示

$ pgenv cluster -D clusterdir status

クラスタノード追加/削除

$ pgenv cluster -D clusterdir ctrl --attach --fork-off primary standby2
$ pgenv cluster -D clusterdir ctrl --dettach  standby2

クラスタのログをtail

# 全てのインスタンスの最新ログをtail
$ pgenv cluster -D clusterdir tail -f --all

# primaryの最新ログのみtail
$ pgenv cluster -D clusterdir tail -f primary

# 全てのインスタンスの全てのログをtail
$ pgenv cluster -D clusterdir tail -f --all --all-logs

拡張機能

拡張機能の雛形を作成

$ pgenv extension init myext

拡張機能をビルド

$ cd myext
$ pgenv extension install -v @all

拡張機能のリグレッションテスト

$ pgenv extension run -v @all 'initdb  ${ver}data'
$ pgenv extension run -v @all 'pg_ctl start -l $ver.log -D ${ver}data -o "-p $((9000+i))"'
$ pgenv extension run -v @all 'psql -p $((9000+i)) postgres -c "create extension myext"'
$ pgenv extension run -v @all 'psql -p $((9000+i)) postgres -c "select myext()"'

参考リンク


トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
目次
ダブルクリックで閉じるTOP | 閉じる
GO TO TOP