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

4

14

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!

Iconoduly answered 30/8, 2013 at 14:9 Comment(0)
E
6

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

Eirena answered 11/11, 2013 at 15:39 Comment(1)
so once you find that sql file, just copy paste into pgadmin and run?Apollonian
C
3

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

Celestaceleste answered 2/1, 2016 at 0:21 Comment(2)
This is not an answer to the question. Am I right? This is not a forum, you should only write an answer when it answers the question, otherwise you have to comment!Standardize
@limoragni: the question says: "in order to install the debugger". Well, This answer explains the proper way to do that. The original asker seems to want to locate the file in order to execute its content. The first comment in the accepted answer also seems to understand that he ought to do the same thing. The real answer is that he doesn't need to locate where the .sql file is nor to run it manually; VictorMartinez explains the proper steps to accomplish his purpose. More precisely, the CREATE EXTENSION pldbgapi; part seems to be what he needs.Justajustemilieu
C
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.

Crinoid answered 4/2, 2017 at 21:45 Comment(2)
on ubuntu 16.04 i had problems with make: "fatal error: gssapi/gssapi.h: No such file or directory" which i resolved by installing libkrb5-dev ( sudo apt-get install libkrb5-dev)Merits
I had the following error message: "plpgsql_debugger.c:12:10: fatal error: postgres.h: No such file or directory" The reason was, that I also had a higher postgres version installed (13) but was running 12. Removing 13 did solve that. ('sudo apt remove postgresql-13')Homing
B
2

For postgres 12, you should install this package using this commad:

apt-get install postgresql-12-pldebugger

There is no need to change the postgresql.conf file. You should also create this extension in the database that you will use for debugging:

CREATE EXTENSION pldbgapi;

I am using PGAdmin 4 for debugging PL/SQL procedures.

Bussey answered 28/7, 2021 at 22:55 Comment(1)
hi, will this work on AWS RDS as well ? Any idea on this?Compassion

© 2022 - 2024 — McMap. All rights reserved.