Re: Can not debug plpgsql using PgAdminIII

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Jeremy Palmer <JPalmer(at)linz(dot)govt(dot)nz>
Cc: "pgadmin-support(at)postgresql(dot)org" <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Can not debug plpgsql using PgAdminIII
Date: 2010-09-25 07:30:58
Message-ID: AANLkTikcvuRU85gK5Hw17U-AwdJNUMnCbXxc0gOvtR_G@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Sat, Sep 25, 2010 at 12:18 AM, Jeremy Palmer <JPalmer(at)linz(dot)govt(dot)nz> wrote:
> Late follow-up on this email!
>
>
>
> Can anyone give any help? Has it been resolved in 1.12?

It's not broken for everyone else afaik. Try removing the profiler
plugin from shared_preload_libraries - it's probably stealing the hook
from the debugger plugin.

> ________________________________
>
> From: Jeremy Palmer
> Sent: Tuesday, August 03, 2010 3:02 PM
> To: pgadmin-support(at)postgresql(dot)org
> Subject: Can not debug plpgsql using PgAdminIII
>
>
>
> 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;
>
>                         shared_preload_libraries
>
> -------------------------------------------------------------------------
>
>  $libdir/plugins/plugin_debugger.dll,$libdir/plugins/plugin_profiler.dll
>
> (1 row)
>
>
>
> 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.
>
>
>
> Thanks,
>
> Jeremy
>
>
>
>
>
> ________________________________
> 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.
>
> Thank you.
> ________________________________

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2010-09-25 07:32:25 Re: dropping connection
Previous Message Guillaume Lelarge 2010-09-25 07:22:08 Re: dropping connection