You must enable debugging in two places. In PGAdmin and the database itself. This article that you referred to does a great job of this, but there are some nuances.
PGAdmin
When updating your postgresql.conf file to load the debug library, I ran PGAdmin on Windows , so the file was here:
C:\Program Files\PostgreSQL\9.4\data\postgresql.conf
And the path to plugin_debugger.dll was actually
$libdir/plugin_debugger.dll
not
$libdir/plugins/plugin_debugger.dll
as stated in the article. So your postgresql.conf needs a line like this
shared_preload_libraries = '$libdir/plugin_debugger.dll'
Find the actual .dll if in doubt. If you are on Linux, the file you are looking for is plugin_debugger.so . Remember that changing the postgresql.conf file will require a reboot for the changes to take effect.
PostgreSQL Database
Assuming you are using your PostgreSQL database on a Linux server, this method does an excellent job of explaining how to load dependencies to enable debugging. Make sure you use root during installation.
The easy-to-skip part issues a command against the actual database that you want to debug. For newer versions on PostgreSQL, all you need to do is the following:
CREATE EXTENSION IF NOT EXISTS pldbgapi;
If this does not return an error, you should be good to go.
Some noteworthy notes:
- As mentioned above, you can only debug when working as a superuser account.
- From your documents, you can only debug pl / pgsql functions. Therefore, if your function says something like
LANGUAGE c PGAdmin, it will not even display the Debug option with the right mouse button when selecting a function. Find something that has LANGUAGE plpgsql and the Debug menu should show.
Joel B Jan 21 '16 at 23:25 2016-01-21 23:25
source share