[Solved] Cannot connect to PostgreSQL through TPQConnection on MacOS lazarus / 16-Databases ---------------------------------------------------------------------- dirkjvanderveen ยท 2023-02-22 16:39 After working with MySQL I want to use PostgreSQL as database on my MacBook Pro with MacOS Ventura 13.2.1. I installed the newest version (15.2) of the PostgreSQL server at the proposed default location ( /Library/PostgreSQL). The maintenance tool pgAdmin works fine but connecting my application an exception is raised when trying to connect to it: - Can not load PostgreSQL client library \"libpq.dylib\". Check your installation. I did check my installation and added the directory /Library/PostgreSQL/15/lib to the environment variable DYLD_LIBRARY_PATH. Because in that directory the file libpq.dylib is located. Unfortunately without any result. Do anyone has know how to setup the connection from Lazarus to PostgreSQL correctly? Edit: It is solved by adding the following symbolic link: ln - s /Library/PostgreSQL/15/lib/libpq.5.15.dylib /usr/local/lib/libpq.dylib