Re: Implementing SQL/PSM for PG 8.2 - debugger - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Implementing SQL/PSM for PG 8.2 - debugger
Date
Msg-id Pine.LNX.4.44.0506281558450.9650-100000@kix.fsv.cvut.cz
Whole thread Raw
In response to Re: Implementing SQL/PSM for PG 8.2 - debugger  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Implementing SQL/PSM for PG 8.2 - debugger
List pgsql-hackers
On Tue, 28 Jun 2005, Tom Lane wrote:

> Pavel Stehule <stehule@kix.fsv.cvut.cz> writes:
> >> What do you think you need for enhanced protocol ?
> 
> > What I need? Some like synchronous elog(NOTICE,''), which can return some 
> > user's interaction, if it's possible. I didn't find how I do it with 
> > current set of messages. But my knowleadges of protocol are minimal.
> 
> It'd probably be smarter to manage the debugging across a separate
> connection, so that you could carry out debugging without requiring
> sophisticated support for it inside the client program.  If it's
> single-connection then it will be essentially impractical to debug
> except from a few specialized clients such as pgadmin; which will
> make it hard to investigate behaviors that are only seen under load
> from a client app.

I don't think it. Debug process halt query process in bouth variants - 
remote | protocol. Remote debugging has one advance. I can monitor any 
living plpgsql process, but I have to connect to some special port, and it 
can be problem. Protocol debugging can be supported libpq, and all clients 
libpq can debug. But is problem if PostgreSQL support bouth variants?

btw: debuging have to be only for some users,GRANT DEBUG ON LANGUAGE plpgsql TO ..

For me, is better variant if I can debug plpgsql code in psql console. 
Without spec application. I don't speak so spec application don't have to 
exists (from my view, ofcourse). 

Maybe:set debug_mode to true; -- if 't' then func stmt has srcreset function myfce(integer, integer); -- need
recompilationcreatebreakpoint on myfce(integer, integer) line 1;select myfce(10,10);dbg> \l .. list current line     \c
..continue     \n .. next stmt            \L .. show src     \s .. show stack     \b .. switch breakpoint            \q
..quit function            select myvar+10 .. any sql expression     variable .. print variable    \cmyfce       -----
     10
 
that's all. Maybe I have big fantasy :). 

Regards
Pavel

+ small argument: if psql support debug mode, I don't need leave my emacs 
postgresql mode.



> 
> I don't know exactly how to cause such a connection to get set up,
> especially remotely.  But we should try to think of a way.
> 
>             regards, tom lane
> 



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: bug: LC_CTYPE=en_US.UTF-8 confuses query planner
Next
From: Tom Lane
Date:
Subject: Re: commit_delay, siblings