Proposal for debugging of server-side stored procedures - Mailing list pgsql-hackers

From Mark Cave-Ayland
Subject Proposal for debugging of server-side stored procedures
Date
Msg-id 200605291626.k4TGQBd13526@webbased16.localdomain
Whole thread Raw
Responses Re: Proposal for debugging of server-side stored procedures
List pgsql-hackers
Hi everyone,
Having browsed the TODO list, one of the items that I would be interested
on working on is a debugger for stored procedures. Having searched on this
topic in the archives, I'm still short of some answers that would allow me
to come up with a complete proposal that I can use to start coding.
The most important question to answer in my mind is how should the
debugger communicate with the server? I can see 3 ways in which this could
happen:    1) Use the existing FE/BE protocol to allow the user to control    the debugging session using stored
procedures/pseudo-tables,e.g.        SELECT pg_debug_enable('myfunction');        INSERT INTO pg_debug_breakpoints
(function,line) VALUES        ('myfunction', 2);        SELECT pg_debug_step('myfunction');    2) Spawn a separate
debuggerprocess listening on another port to    allow OOB communication with the server. This would involve the
 
design    and implementation of a debug FE/BE protocol, unless there is a    standard that already exists.    3) Extend
theexisting FE/BE protocol to allow transmission of an
 
OOB    debug channel.
My current thoughts are leaning towards 2 or 3, with the advantage of
approach 3 being that once you can connect to the database using a client,
the debugging functionality automatically becomes available without having
to worry about additional security checks on the debugger port (like
another version of pg_hba.conf just for the debugger) and firewalls
blocking debugger connections.
Thoughts?
Mark.

------------------------
WebBased Ltd
17 Research Way
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023

http://www.webbased.co.uk
http://www.infomapper.com
http://www.swtc.co.uk

This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it
or use it for any purpose nor disclose or distribute its contents to any
other person.





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: some question about deadlock
Next
From: Tom Lane
Date:
Subject: Re: Proposal for debugging of server-side stored procedures