Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 501
Di Zou Avatar asked Aug 30 '13 14:08

Di Zou


People also ask

How do I enable debugging in PostgreSQL?

The Debugger is available as an extension for your PostgreSQL installation, and is distributed as part of Advanced Server. You must have superuser privileges to use the debugger. After modifying the shared_preload_libraries parameter, restart the server to apply the changes.

How do I install a debugger in Pgadmin 4?

To set a breakpoint at the first line of a program, right-click the name of the object you would like to debug, and select Set breakpoint from the Debugging sub-menu. The debugger window will open, waiting for another session to invoke the program.


2 Answers

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

like image 193
HH321 Avatar answered Sep 22 '22 16:09

HH321


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

like image 25
VictorMartinez Avatar answered Sep 21 '22 16:09

VictorMartinez