I'm building a lot of PL/pgSQL functions and a debugger would really come in handy because RAISE NOTICE is not enough.

I read about a pgAdmin plugin you can install but it was only on Windows and I'm running Mac OS X.

  • I was under the strong impression the plpgsql debugger was portable. It's here: git.postgresql.org/gitweb/?p=pldebugger.git;a=summary – Craig Ringer Feb 26 '14 at 23:15
  • I guess I would need to recompile PostgreSQL in order to use pldebugger. Do you know any other way? Recompiling the dbms is something I want to avoid. – Oxfist Feb 27 '14 at 18:39
  • Are you sure about that? Pretty sure it's just an extension. Compile the extension and install it. – Craig Ringer Feb 27 '14 at 23:14
  • Yes I'm sure, unless I did something wrong. I unzipped it and the README said to put the files in /contrib in the root folder of PostgreSQL (which didn't have it) and when I ran make I had an error because the /src folder wasn't found clearly because it wasn't there. – Oxfist Feb 28 '14 at 14:30
  • Huh... try make USE_PGXS=1 . If that doesn't work it might need a Makefile fix. – Craig Ringer Feb 28 '14 at 22:08

Here's an article I wrote for how to get one installed on Ubuntu.

Installation instructions for the pldebugger for PostgreSQL

pg_config --version

Look here for source code matching your version of PostgreSQL: ftp://ftp.postgresql.org/pub/source/

For me, it was:

wget ftp://ftp.postgresql.org/pub/source/v9.3beta2/postgresql-9.3beta2.tar.bz2
tar xvjf postgresql-9.3beta2.tar.bz2
cd postgresql
USE_PGXS=1 ./configure
USE_PGXS=1 make
cd contrib
git clone git://git.postgresql.org/git/pldebugger.git
cd pldebugger
USE_PGXS=1 make
sudo USE_PGXS=1 make install

These instructions assume that you have the development packages for your version of PostgreSQL already installed on your system.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.