hgdbdeveloper無法使用調(diào)試功能

1、 問題描述:

使用hgdbdeveloper工具無法使用函數(shù)調(diào)試功能

2、 解決過程

__原因__:缺少插件pldebugger

(1)移動(dòng)、解壓:

將下載好的壓縮包(pldebugger.zip)移動(dòng)到數(shù)據(jù)庫安裝目錄contrib。

mv pldebugger.zip  /opt/HighGo5.6.5/share/contrib unzip pldebugger.zip

(2)編譯安裝pldebugger

cd /opt/HighGo5.6.5/share/contrib/pldebugger/ 

執(zhí)行命令:make

如果報(bào)錯(cuò),加USE_PGXS=1,原因可以自行搜索。make: *** 沒有規(guī)則可以創(chuàng)建目標(biāo) “/contrib/contrib-global.mk”。 停止則使用命令:make USE_PGXS=1 install。

如果報(bào)錯(cuò)/opt/HighGoDB-4.3.4.6/include/server/libpq/libpq-be.h:25:25: 致命錯(cuò)誤:openssl/ssl.h:沒有那個(gè)文件或目錄。則安裝openssl。

yum install openssl-devel 
make USE_PGXS=1 instal

安裝完后在postgresql目錄的Lib文件夾可以看到plugin_debugger.so文件 cd /opt/HighGo5.6.5/lib/postgresql

(3)postgresql配置文件配置

vi /opt/HighGo5.6.5/data/postgresql.conf 修改配置文件參數(shù)如下,如果多個(gè)參數(shù)逗號(hào)分開 
shared_preload_libraries = '/opt/HighGoDB5.6.5/lib/plugin_debugger.so'

(4)重啟數(shù)據(jù)庫

pg_ctl restart -m fast

(5)創(chuàng)建擴(kuò)展模塊

使用highgo用戶登錄數(shù)據(jù)庫 
psql -U highgo -d highgo
執(zhí)行語句創(chuàng)建擴(kuò)展模塊
create extension pldbgapi;
查看插件是否安裝成功
select * from pg_extension;

(6)安裝完成。

附:客戶環(huán)境為內(nèi)網(wǎng)環(huán)境無法從網(wǎng)絡(luò)上獲取依賴包。Pldebugger的依賴包只有openssl,客戶環(huán)境可能沒有,實(shí)施時(shí)建議攜帶openssl的依賴包。