Where can I get pldbgapi.sql in order to install the debugger for postgresql?

浪尽此生 提交于 2019-12-21 04:01:44

问题


I am trying to install the debugger for postgresql on Linux so I can use pgAdmin to debug my functions. I've set up my postgresql.conf file. However, I can't find pldbgapi.sql.

Postgresql is installed at /usr/pgsql-9.2/. The directory /usr/pgsql-9.2/share/ exists, but /usr/pgsql-9.2/share/contrib does not exist. Where can I find the file or download it?

Thanks!


回答1:


I've found out it works if I run the contents of this file

share\extension\pldbgapi--1.0.sql 

There is also this readme for the extension which mentions a different installation process, I haven't tried it

http://git.postgresql.org/gitweb/?p=pldebugger.git;a=blob_plain;f=README.pldebugger;hb=54d993c04809da7cda79013a55b679a615c7dce1




回答2:


Excelent aport, only:

  • 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;

  • Restart PostgreSQL for the new setting to take effect. Finally you can debugg!!

I used in Postgres 9.4




回答3:


This is included with EnterpriseDB distributive. You can download it on pgFoundry. here is a link

Also git repo is available.

git clone git://git.postgresql.org/git/pldebugger.git
cd pldebugger
export USE_PGXS=1
make
make install

Edit postgresql.conf

vim /path/to/postgresql.conf

add:

shared_preload_libraries = 'plugin_debugger'

Restart postgres, connect to db and call:

CREATE EXTENSION pldbgapi;

I use it on postgreql 9.5, works well.



来源:https://stackoverflow.com/questions/18534998/where-can-i-get-pldbgapi-sql-in-order-to-install-the-debugger-for-postgresql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!