Proposal for debugging of server-side stored procedures

From: "Mark Cave-Ayland" <m(dot)cave-ayland(at)webbased(dot)co(dot)uk>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Proposal for debugging of server-side stored procedures
Date: 2006-05-29 16:25:55
Message-ID: 200605291626.k4TGQBd13526@webbased16.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 debugger process 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 the existing 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.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-05-29 17:05:19 Re: Proposal for debugging of server-side stored procedures
Previous Message Tom Lane 2006-05-29 16:16:35 Re: some question about deadlock