For those on M1-Based macs who are currently seeing this issue in docker – there appears to a bug upstream in libpg that’s building against the wrong library version on ARM.
Until it’s fixed, a workaround is to (at a performance hit) is to just run it via rosetta.
export DOCKER_DEFAULT_PLATFORM=linux/amd64
, and re-build your images.
You’ll get the latest version of libpq, and things should Just Work.