Further to my previous post, I wanted to enable debugging in PostgreSQL Docker container so that it can be used together with PGAdmin4.

The challenge is it is not enabled by default in any of available Docker images; I also tried to recompile from source but failed with different kinds of errors.

Just for information, the debugger has its git site where you can find all source code here: https://git.postgresql.org/gitweb/?p=pldebugger.git;a=summary

At the end I found a simple solution because the debugger extension is already in Debian’s package repository (https://packages.debian.org/sid/amd64/postgresql-11-pldebugger/download) , all we need to do is to use official PostgreSQL Docker image and then install this extension.

Below is my docker-compose.yml

Below is my Dockerfile for the PostgreSQL image, with debugger installed at the end. ( My link above is for PG V11 but V10 exists as well,  you can simply change environment variable ENV PG_MAJOR 10 to ENV PG_MAJOR 11)

Run the following commands to build and bring up the containers

Then login to the PostgreSQL instance using PGAdmin, on port 15432(this is re-directed by Docker itself)

In the DB you’re working in, install the extension

 

Done!

Building a PostgreSQL docker container with debugger (pldebugger)
Tagged on:                     

2 thoughts on “Building a PostgreSQL docker container with debugger (pldebugger)

    • November 26, 2019 at 10:14 pm
      Permalink

      yes free to share as long as you mention the source

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

77 + = 79

This site uses Akismet to reduce spam. Learn how your comment data is processed.