I added - postgresql-simple to the dependencies on package.yaml of my Haskell stack project and then did stack build and got:
While building package postgresql-libpq-0.9.4.3 (scroll up to its section to see the error) using:
/tmp/stack-89da86d626e343e1/postgresql-libpq-0.9.4.3/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0 configure --user --package-db=clear --package-db=global --package-db=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/pkgdb --libdir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/lib --bindir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/bin --datadir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/share --libexecdir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/libexec --sysconfdir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/etc --docdir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/doc/postgresql-libpq-0.9.4.3 --htmldir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/doc/postgresql-libpq-0.9.4.3 --haddockdir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/doc/postgresql-libpq-0.9.4.3 --dependency=Cabal=Cabal-3.2.1.0 --dependency=base=base-4.14.1.0 --dependency=bytestring=bytestring-0.10.12.0 --dependency=unix=unix-2.7.2.2 -f-use-pkg-config --exact-configuration --ghc-option=-fhide-source-paths
Process exited with code: ExitFailure 1
The container has protgresql installed like this:
RUN apt-get update && apt-get install -y wget lsb-release
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update && apt-get -y install postgresql
and pg_config works.
Even though it says scroll up to its section to see the error there are no errors above.