It took me a while to figure out how to enable debugger for Postgresql server on Ubuntu. Initially I thought it was pre-packaged by Ubuntu therefore apt-get installed a few packages such as pgadmin3, pgadmin3-dev, postgresql-version.dbg. Here is a post