PostgreSQL pl/pgsql Debugger API
================================

This module is a set of shared libraries which implement an API for debugging
pl/pgsql functions on PostgreSQL 8.4 and above. The pgAdmin III project
(http://www.pgadmin.org/) provides a client user interface as part of pgAdmin 
III v1.10.0 and above.

If you wish to debug functions on PostgreSQL 8.2 or 8.3, please use v0.93 of
the debugger plugin, or checkout the PRE_8_4_SERVER branch from CVS.

Installation
------------

- Copy this directory to contrib/ in your PostgreSQL source tree.

- Run 'make; make install'

- Edit your postgresql.conf file, and modify the shared_preload_libraries config
  option to look like:

  shared_preload_libraries = '$libdir/plugins/plugin_debugger'

- (Re)start PostgreSQL, and run the pldbgapi.sql SQL script in the database or
  databases that you wish to debug functions in.

Usage
-----

Connect pgAdmin to the database containing the functions you wish to debug.
Right-click the function to debug, and select Debugging->Debug to execute and
debug the function immediately, or select Debugging->Set Global Breakpoint to
set a breakpoint on the function. This will cause the debugger to wait for
another session (such as a backend servicing a web app) to execute the function
and allow you to debug in-context.

For further information, please see the pgAdmin documentation.

Troubleshooting
---------------

The majority of problems we've encountered with the plugin are caused by
failing to add (or incorrectly adding) the debugger plugin library to the
shared_preload_libraries configuration directive in postgresql.conf (following
which, the server *must* be restarted). This will prevent global breakpoints
working on all platforms, and on some (notably Windows) may prevent the 
pldbgapi.sql script from executing correctly.

Licence
-------

The pl/pgsql debugger API is released under the Artistic Licence.

    http://www.opensource.org/licenses/artistic-license.php

Copyright (c) 2004-2010 EnterpriseDB Corporation. All Rights Reserved.

Contact
-------

For support, please email the pgAdmin support mailing list. See

http://www.pgadmin.org/support/ 

for more details.
