Toad World® Forums

Cannot Load libpq.dll when trying to connect to Postgres

I am trying to connect to Postgres using Toad Data Modeler.

I tried both the Open Source version 4.1.6 and Beta version and both throw up the error, “cannot load library libpq.dll” when I try to connect to my PosgreSQL 9.1.3 DB.

My Postgres is installed on a linux server, but I have access to the Postgres 32-bit windows version. I took the libpq.dll from Postgres windows and copied it into both my toad/bin and windows/system32 and I still get the error.

I am running Windows XP.

Any ideas on how to get this issue resolved? Message was edited by: russelljanusz_937

Message was edited by: russelljanusz_937


please download the latest TDM version 4.2.6 (trial version should be available on This new version includes support for PostgreSQL 9.1 and there is possibility to use Native Connection that no longer requires libpq.dll files.

In the following article you can find info about what libraries were required for TDM 4.1 and PostgreSQL 9.0. I suppose there won’t be much differences, but I didn’t test it personally because the latest version with native connection works just fine for me :slight_smile:



Sorry. 4.2.6 doesn’t work either.

I get the same error about libpq.dll when creating an obsolete connection. When trying to create a native connection, I simply get a “Cannot connect to the database” error. User/ID combo is correct as is the hostname and port.

Any other suggestions?

Message was edited by: russelljanusz_937

Then the issue must be somewhere else.
Please, check your firewall if the port used to connect to postgres db is not blocked.
Or you may need to allow your XP client machine to access your db server in pg_hba.conf configuration file. See for more information.


I can connect to Postgres via pgAdmin, so I don’t think there’s a firewall issue. My username is in the pg_hba.conf file.

WOO HOO… I’m connected.
I had to pull out the following DLLs from a Windows32 bit install.

  • libeay32.dll
  • libiconv-2.dll
  • libintl-8.dll
  • libpq.dll (already had this one. Needed all of the others)
  • ssleay32.dll

No sure why the error was, “missing libpq.dll” when I was actually missing the other four libaries.

The message “Error loading library ‘libpq.dll’” was the original error in case of PosgreSQL dbs when there was a missing library.
A hint which libraries need to be available is in RE Wizard when selecting Connection Type.
There is also a document in the TDM community library at

Since Toad Data Modeler 4.2.6, no client or libraries are necessary for Native Connection to PostgreSQL dbs.