postgresql関数デバッグツールpldebuggerインストール手順
4332 ワード
1.pldebuggerインストールパッケージをダウンロードする:
http://git.postgresql.org/gitweb/サードパーティ製プラグインはすべてここでダウンロードできます.ここでpldebuggerをダウンロードします.git
2.コピー、インストールはダウンロードした圧縮パッケージ(pldebugger-14 c 6 caf.tar.gz)をpostgresqlインストールディレクトリcontribにコピーします.解凍:
reademeファイルを表示し、インストール要件を確認します.
以上から分かるように、make&make installだけで構成などを行います.以上の要求に従って具体的に以下のように取り付ける.
インストールが完了すると、プラグインはpostgresqlディレクトリのLibファイルにインストールされ、libディレクトリを表示すると表示されます.
構成パラメータ:
次のように設定します.
*ここでは、構成パラメータshared_preload_libraries = '$libdir/plugin_debugger'の場合、このパラメータが複数ある場合は、カンマを付けるだけでいいです.
データベースを再起動し、関数デバッグが必要なデータベースでCREATE EXTENSION pldbgapiを実行します.注:ライブラリを交換するたびに、再実行します.
以上の手順でpgadminを開き、関数を選択すると次のように表示されます.
デバッグ機能が表示され、インストールに成功しました.
http://git.postgresql.org/gitweb/サードパーティ製プラグインはすべてここでダウンロードできます.ここでpldebuggerをダウンロードします.git
2.コピー、インストールはダウンロードした圧縮パッケージ(pldebugger-14 c 6 caf.tar.gz)をpostgresqlインストールディレクトリcontribにコピーします.解凍:
tar zxvf pldebugger-14c6caf.tar.gz
reademeファイルを表示し、インストール要件を確認します.
Installation
------------
- Copy this directory to contrib/ in your PostgreSQL source tree.
- Run 'make; make install'
- Edit your postgresql.conf file, and modify the shared_preload_libraries config
option to look like:
shared_preload_libraries = '$libdir/plugin_debugger'
- Restart PostgreSQL for the new setting to take effect.
- Run the following command in the database or databases that you wish to
debug functions in:
CREATE EXTENSION pldbgapi;
(on server versions older than 9.1, you must instead run the pldbgapi--1.0.sql
script directly using psql).
以上から分かるように、make&make installだけで構成などを行います.以上の要求に従って具体的に以下のように取り付ける.
[[email protected] pldebugger-14c6caf]# make
gcc -Wall -Wmissing-prototypes
-Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
-fwrapv -O2 -fpic -I../../src/pl/plpgsql/src -I. -I. -I../../src/include
-D_GNU_SOURCE -c -o plpgsql_debugger.o plpgsql_debugger.c
gcc
-Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -I. -I.
-I../../src/include -D_GNU_SOURCE -c -o plugin_debugger.o
plugin_debugger.c
gcc -Wall
-Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Wendif-labels -Wmissing-format-attribute -Wformat-security
-fno-strict-aliasing -fwrapv -O2 -fpic -I. -I. -I../../src/include
-D_GNU_SOURCE -c -o dbgcomm.o dbgcomm.c
gcc
-Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -I. -I.
-I../../src/include -D_GNU_SOURCE -c -o pldbgapi.o pldbgapi.c
gcc
-Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -shared -o
plugin_debugger.so plpgsql_debugger.o plugin_debugger.o dbgcomm.o
pldbgapi.o -L../../src/port -L../../src/common -Wl,--as-needed
-Wl,-rpath,'/usr/local/pgsql9.5.0/lib',--enable-new-dtags
[[email protected] pldebugger-14c6caf]# make install
/bin/mkdir -p '/usr/local/pgsql9.5.0/lib'
/bin/mkdir -p '/usr/local/pgsql9.5.0/share/extension'
/bin/mkdir -p '/usr/local/pgsql9.5.0/share/extension'
/bin/mkdir -p '/usr/local/pgsql9.5.0/share/doc//extension'
/usr/bin/install -c -m 755 plugin_debugger.so '/usr/local/pgsql9.5.0/lib/plugin_debugger.so'
/usr/bin/install -c -m 644 ./pldbgapi.control '/usr/local/pgsql9.5.0/share/extension/'
/usr/bin/install -c -m 644 ./pldbgapi--1.0.sql ./pldbgapi--unpackaged--1.0.sql '/usr/local/pgsql9.5.0/share/extension/'
/usr/bin/install -c -m 644 ./README.pldebugger '/usr/local/pgsql9.5.0/share/doc//extension/'
インストールが完了すると、プラグインはpostgresqlディレクトリのLibファイルにインストールされ、libディレクトリを表示すると表示されます.
-bash-4.1$ ll |grep debug
-rwxr-xr-x. 1 root root 62025 Mar 10 09:09 plugin_debugger.so
構成パラメータ:
次のように設定します.
shared_preload_libraries = '$libdir/plugin_debugger'
*ここでは、構成パラメータshared_preload_libraries = '$libdir/plugin_debugger'の場合、このパラメータが複数ある場合は、カンマを付けるだけでいいです.
shared_preload_libraries = 'xxxxxx,$libdir/plugin_debugger'
データベースを再起動し、関数デバッグが必要なデータベースでCREATE EXTENSION pldbgapiを実行します.注:ライブラリを交換するたびに、再実行します.
以上の手順でpgadminを開き、関数を選択すると次のように表示されます.

デバッグ機能が表示され、インストールに成功しました.