Обсуждение: Can not debug plpgsql using PgAdminIII

Поиск
Список
Период
Сортировка

Can not debug plpgsql using PgAdminIII

От
Jeremy Palmer
Дата:

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@linz.govt.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.

Re: Can not debug plpgsql using PgAdminIII

От
Jeremy Palmer
Дата:

Late follow-up on this email!

 

Can anyone give any help? Has it been resolved in 1.12?

 


From: Jeremy Palmer
Sent: Tuesday, August 03, 2010 3:02 PM
To: pgadmin-support@postgresql.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@linz.govt.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.

Re: Can not debug plpgsql using PgAdminIII

От
Dave Page
Дата:
On Sat, Sep 25, 2010 at 12:18 AM, Jeremy Palmer <JPalmer@linz.govt.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@postgresql.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@linz.govt.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


Re: Can not debug plpgsql using PgAdminIII

От
Jeremy Palmer
Дата:
> ________________________________
>
> From: Dave Page
> Sent: Sat, 25 Sep 2010 00:31:15 -0700
> To: pgadmin-support@postgresql.org
> Subject: Re: Can not debug plpgsql using PgAdminIII
>
>
>It's not broken for everyone else afaik. Try removing the profiler plugin from shared_preload_libraries - it's
probablystealing >the hook from the debugger plugin. 

Thanks that seemed to fix it. It could be good idea to document that you can't run both of these shared libraries at
thesame time, or fix the situation. 

I'm very happy that I now have the debugger working! One little annoyance when debugging functions with more that 1
screenof definition is the scroll position is always set with the line cursor at the bottom of the text control. This
makesit hard to see the code coming. I would suggest either advancing the scroll position so the line cursor is at the
topof page, or not moving the scroll position at all unless the next step takes the cursor off the bottom on the text
controlso the user can define what they see. 

Cheers,
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@linz.govt.nz) and
destroythe original message. 
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________