There is an API - I wouldn't want to try to use it from the
command-line, but you certainly can. You would call functions such as:
1. can be integrated into psql?
SELECT * FROM pldbg_set_breakpoint( 'myfunction' );
SELECT * FROM pldbg_wait_for_breakpoint( ... );
SELECT * FROM pldbg_step_into( ... );
SELECT * FROM pldbg_continue( .. .);
Since it is driven by an API, you can code up a user interface in
whatever language/environment you like.
I'm not quite sure what you mean there. The debugger works in two
2. can be started from query execution (with breakpoint). Now I have
to expliciltly start debugged function.
1) In-context debugging: you set a breakpoint on a function (from
within a tool like pgAdmin) and then invoke that function from some
other client application
2) Direct debugging: you set a breakpoint on a function and the
debugger invokes that function on your behalf.
In pgAdmin, you start an in-context debugging by choosing the "Set
Breakpoint" (or perhaps "Set Global Breakpoint") option and you start a
direct debugging session by choosing the "Debug Function" option (sorry,
I don't have a copy of pgAdmin in front of me so I may have the spelling
wrong in there somewhere).