Docker Community Forums

Share and learn in the Docker community.

Logical replication from Posgres on Windows to Postgres in docker container on Linux


I’m using the bitnami/postgresql:latest image and I’m able to connect from a Win32 program (Delphi using the Unidac drivers) to PostgreSQL database running on Ubuntu server in a docker container.

The users will use a Win32 program to capture field survey data offline and then they want to replicate the data to the PostgreSQL database on Ubuntu server.

It seems to me I should use logical replication because a user may work with only a subset of the total master database on the Ubuntu server.

I must be able to do a mapping of the postgresql.conf and the pg_hba.conf files.
The part of my docker-compose.yml file to run PostgreSQL in a docker container:

    restart: unless-stopped
    container_name: postgres
    image: bitnami/postgresql:latest
      - TZ="Africa/Johannesburg"
      - POSTGRES_DATABASE=sdb_risk
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=xxxxxxxxxxxxxxxx
      - 5432:5432
      - 5433:5433
      - ./postgres_data:/bitnami/postgresql
#      - .pg_hba.conf:/bitnami/postgresql/conf/pg_hba.conf
#      - .postgresql.conf:/bitnami/postgresql/conf/postgresql.conf 
      - dreamfactory-tier
      - app-tier

My question is: Am I on the right track to do a logical replication and if so, how do I map the pg_hba.conf and postgresql.conf files?


Nols Smit

I’m not able to reproduce
( is the host’s IP, so the connection is [container]->[host]->[container]

$ docker run --rm --name pg-docker -e POSTGRES_PASSWORD=docker -d -p 5432:5432 postgres

$ docker run -it --rm postgres bash
root@64564e59b3fc:/# psql -h -U postgres -d postgres
Password for user postgres:
psql (12.2 (Debian 12.2-2.pgdg100+1))
Type “help” for help.