0

I'm trying to using psqlODBC driver to receive data from PostgreSQL to Excel in macOS Catalina.

But I keep getting this error IM003 [iODBC][Driver Manager]Specified driver could not be loaded

image

Following things are the method I've tried but still don't succeed.

  • Disable SIP

  • Move psqlodbca.so under the /Library/ODBC folder in order to let Excel open in sandbox environment.

  • Changed original /usr/lib/libpq.5.dylib to PostgreSQL's dylib file by using command

    sudo ln -s /postgresql_install_folder/lib/libpq.5.dylib /usr/lib/libpq.5.dylib

I download the source from https://www.postgresql.org/ftp/odbc/versions/src/ and follow this article https://odbc.postgresql.org/docs/unix-compilation.html to compile the driver and install the psqlodbca.so under /Library/ODBC

My /Library/ODBC/odbc.ini

[ODBC Data Sources]
postgresAscii   = ascii

[postgresAscii]
Driver          = {ascii}
Description     = postgres odbc for user type ascii
Database        = db
Server          = 127.0.0.1
Port            = 5432
FetchBufferSize = 99

My /Library/ODBC/odbcinst.ini

[ODBC Drivers]
ascii = Installed

[ascii]
Driver = /Library/ODBC/psqlodbca.so
Setup  =

I can connected to my DB using iODBC Administrator64.app

connected_using_iODBCAdmin64

  • Have you tried to connect with `iODBC Administrator.app`? Or `iODBC Administrator64.app`? Or `iODBC Demo.app`? Basically -- start with simpler things, and then move on to Excel when the basics are working. My immediate first-guess is that your `psqlodbca.so` is 32-bit while Excel is 64-bit ... but there are many other possibilities. – TallTed Mar 04 '21 at 20:49
  • Hi, @TallTed my psqlodbca.so I believed is 64-bits here is what `file` command `/Library/ODBC/psqlodbca.so: Mach-O 64-bit bundle x86_64` – elijahtsai_ Mar 08 '21 at 04:28
  • and yes, I can connect to DB using `iODBC Administrator64.app` – elijahtsai_ Mar 08 '21 at 04:34
  • The new image shows connection and query working through `iODBC Demo.app`, not `iODBC Administrator64.app` -- but that's OK; we now know that the driver is basically working. Now we can focus on how Excel works differently from the others. Sandboxing is the biggest thing, so let's see whether the PostgreSQL driver has any external dependencies that aren't within Excel's sandbox. Please add output of `otool -L /Library/ODBC/psqlodbca.so` to your question. Please also provide the complete version and date of `Excel` (via Excel menu `About…`) and `iODBC Administrator64.app` (from `About` tab). – TallTed Mar 08 '21 at 15:27
  • iODBC 3.52.15 shipped recently, and included a number of fixes for recent versions of macOS. You might try installing a new build and repeating your connection attempts from Excel. – TallTed Jul 15 '21 at 18:31

0 Answers0