egnew 5 Posted December 1, 2024 I would like to get the Firedac Query Editor in the IDE to work with Postgresql. When I click the execute button in the Firedac Query Editor, I get this message: [FireDAC][Phys][PG]-314. Cannot load vendor library [C:\Prograqm Files\PostgreSQL\17\bin\libpq.dll. Library has unsupported architecture [x64]. Required [x86] %1 is not a valid Win32 application. Hint: check it is in the PATH or application EXE directories, and has x86 bitness. The library mentioned is the directory containing the installation for PostgreSQL. I want to override that and have it use the 32-bit library which is in c:\postgresql\odbc32\bin. My system path begins with c:\postgresql\odbc32\bin; and does not mention the path the IDE is using. The IDE override path is set to: $(PUBLIC)\Documents\Embarcadero\InterBase\redist\InterBase2020\IDE_spoof;$(PATH) How do I get the IDE to use the 32-bit library? Thanks Share this post Link to post
weirdo12 21 Posted December 1, 2024 I mentioned this in another thread. It may help. I don't open database or edit queries in the IDE so it may not. Quote In my experience, putting libpg.dll and its dependencies in debug\lib and release\lib works and eliminates having to specify a folder in the driver component. Share this post Link to post
weirdo12 21 Posted December 1, 2024 (edited) The error you show is typical of what I see if the 32-bit Visual Studio C++ Runtime is not installed. https://www.canscale.com/support/software/dispatch/docs/3.1/webhelp/dsptch31.htm?postgresql_troubleshooting.htm Edited December 1, 2024 by weirdo12 Share this post Link to post
egnew 5 Posted December 2, 2024 My system already has all Visual C++ Runtimes as this is my development computer. Share this post Link to post
Roger Cigol 111 Posted December 2, 2024 Modern versions of PostgreSQL are only available in 64bit architecture. The RAD Studio IDE is a 32 bit application. It is not possible to interface to the modern postgreSQL at design time using the IDE. I have seen examples of people using an old version of the postgreSQL interface dll (a 32 bit version) to talk to modern version of PostgreSQL server. It may work but it cannot be a "guaranteed to work" route since you are asking for a dll to be compatible with a version that wasn't written at the time the dll was created. I've never wasted time trying to get this to work. Share this post Link to post
egnew 5 Posted December 2, 2024 (edited) I posted a solution for my non-IDE issue with PostgreSQL drivers at: https://en.delphipraxis.net/topic/12623-firedac-cannot-load-postgresql-vendor-library/ The solution to enable PostgreSQL in the IDE is to do the following: Go to Tools>Options>Environment Variables>. Under User System Overrides double click PATH and add the path to your 32-bit and 64-bit PostgreSQL drivers. The updated user system override path on my system: c:\postgresql\odbc32\bin;c:\postgresql\odbc64\bin;$(PUBLIC)\Documents\Embarcadero\InterBase\redist\InterBase2020\IDE_spoof;$(PATH) I downloaded the 32-bit and 64-bit drivers using Application Stack Builder installed with PostgreSQL database. I will no longer follow this topic as I have provided a simple and effective solution. Edited December 2, 2024 by egnew Discovered issues if you don't include both 32-bit and 64-bit drivers in system override path. Share this post Link to post
weirdo12 21 Posted December 2, 2024 I did some quick searching about this 32-bit/64-bit client libraries and old version/new version server issue as it relates to PostgreSQL. For the record, here's what Tom Lane (core PostgreSQL developer) has to say: Share this post Link to post