PostgreSQL application on MacOS Monterey

Gday folks,
I’m writing a delphi application which is supposed to connect to a remote postgresql database server. This application works well in Windows, but fails on trying to load libpq.dylib.

A while ago, when macos supported 32-bit apps, this application happily connected to the DB, but no longer. For the 32-bit app, I copied the libpq libraries from pgadmin v3, which itself was 32-bit. Using the same approach for 64-bit, I copied the libpq libraries from pgadmin v4. These are libpq.5.11.dylib (libpq.dylib is a copy of this), libssl.1.1.dylib and libcrypto.dylib (from my deployment panel).

“file libpq.dylib” reports that it is a “Mach-0 64-bit dynamically linked shared library x86_64”.

Currently I’m deploying the dylibs into Contents\Resources\Startup, but I’ve tried Contents\MacOS (same directory as executable) and Contents\Resources.

Since MacOS doesn’t let me install them into /usr/lib, can someone please tell me what I need to do to make the application see its libraries?


I haven’t tried this, but you could try installing it using brew

brew install libpq

My macbook is dead (think the SSD is stuffed) so can’t test this.

The install works, but it installs the ARM binaries, and I can’t build for ARM yet! Will see if I can get x86 binaries…
But this is a great lead, thank you!