I'm trying to debug plpgsql functions in PgAdmin using the integrated debugger but I can't get a debug session to start. I right click on any plpgsql function and get the debugging context menu with both the "Debug" and "Set breakpoint" options, but neither of them works.
When I try the "Debug" option the parameters input dialog displays. However once I enter the parameter values and select OK, the function fully executes, I don't go into a debug session, and the parameters input dialog pops up again.
When I try to debug using the "Set breakpoint" option, the debugger dialog loads and the "Waiting for target" starts. But when I execute that function from another query session nothing happens.
I have set the PgadminIII logging to 'debug' and here is what I get when I try to explicitly debug a function called bde.bde_get_app_specific():
2010-08-03 14:51:36 QUERY : Set query (devgeo01:5432): SELECT count(*) AS count, proname FROM pg_proc WHERE oid = 3050079 GROUP BY proname
2010-08-03 14:51:36 INFO : EDB libpq functions are not available.
2010-08-03 14:51:36 INFO : worker thread waiting for some work to do...
2010-08-03 14:51:36 QUERY : SET log_min_messages TO fatal
2010-08-03 14:51:36 QUERY : select t.*, pg_catalog.oidvectortypes( t.argtypes ) as argtypenames, t.argtypes as argtypeoids, l.lanname, n.nspname, p.proretset, y.typname AS rettype from pldbg_get_target_info( '3050079', 'o' ) t , pg_namespace n, pg_language l, pg_proc p, pg_type y where n.oid = t.schema and l.oid = t.targetlang and p.oid = t.target and y.oid = t.returntype
2010-08-03 14:51:36 QUERY : SELECT version();
2010-08-03 14:51:39 QUERY : SELECT count(*) FROM pg_proc WHERE proname = 'pldbg_get_proxy_info';
2010-08-03 14:51:39 QUERY : SELECT proxyapiver FROM pldbg_get_proxy_info();
2010-08-03 14:51:39 QUERY : select plpgsql_oid_debug(3050079);
2010-08-03 14:51:39 QUERY : SELECT * FROM bde.bde_get_app_specific('2743'::integer, 'SURV'::character varying, 'Y'::character)
2010-08-03 14:51:39 INFO : Queueing: SELECT * FROM bde.bde_get_app_specific('2743'::integer, 'SURV'::character varying, 'Y'::character)
2010-08-03 14:51:39 INFO : 1 commands in queue
2010-08-03 14:51:39 INFO : Executing: SELECT * FROM bde.bde_get_app_specific('2743'::integer, 'SURV'::character varying, 'Y'::character)
2010-08-03 14:51:39 INFO : Complete: PGRES_TUPLES_OK
2010-08-03 14:51:39 INFO : OnTargetComplete() called
2010-08-03 14:51:39 INFO : PGRES_TUPLES_OK
I think I have setup all of the required instrumentation on the server and have loaded the functions correctly. The shared libraries have been added to the server config:
shared_preload_libraries = '$libdir/plugins/plugin_debugger.dll,$libdir/plugins/plugin_profiler.dll'
I have restarted the server and libraries have been loaded:
spi_db=# show shared_preload_libraries;
I have installed support functions into the database with the plpgsql functions:
C:\Program Files\PostgreSQL\8.4\share\contrib>psql -U postgres spi_db < pldbgapi.sql
But I still can not get the debugger to work. It seems to me that debugger connection is not started at all.
I'm using PostgreSQL 8.4.2 compiled by Visual C++ build 1400 32-bit (installed using the EnterpriseDB one click installer) on Windows Server Standard 2003, and PgAdmin 1.10.5 on WinXP SP3. The apart from the changing the memory and connection parameters, the server config is as installed.
This message contains information, which is confidential and may be subject to legal privilege.
If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message.
If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info(at)linz(dot)govt(dot)nz) and destroy the original message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.
pgadmin-support by date
|Next:||From: Little, Douglas||Date: 2010-08-03 19:38:03|
|Subject: Unexplained query activity.|
|Previous:||From: Devrim GÜNDÜZ||Date: 2010-07-31 16:31:29|
|Subject: Re: Install v1.12 on Fedora 13|