tds-fdw / tds_fdw

A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Other
377 stars 101 forks source link

ERROR: could not load library "/home/postgres/PostgreSQL-10/lib/tds_fdw.so": libsybdb.so.5: cannot open shared object file: No such file or directory #237

Open coolloud13 opened 4 years ago

coolloud13 commented 4 years ago

I have installed freetds-1.1.24 and tds_fdw-master and I am unable to create any extension. ERROR: could not load library "/home/postgres/PostgreSQL-10/lib/tds_fdw.so": libsybdb.so.5: cannot open shared object file: No such file or directory

freetds-1.1.24 location - /home/freetds-1.1.24/ postgres - /home/postgres/PostgreSQL-10/

SudoerWithAnOpinion commented 4 years ago

Did you ensure libsybdb5 got installed?

coolloud13 commented 4 years ago

Yes its there. What I have done is I have compiled both the source code at server. I think I have to define SHLIB in make file of tdsfdw to point to LIBRARY of FreeTDS. This is what I have never done before and I have no idea how to do this?

fsando commented 4 years ago

I am on Ubuntu 18.10 and have same problem but libsysdb5 is not installed. How do I ensure libsysdb5 is installed?

SudoerWithAnOpinion commented 4 years ago

Per the ubuntu installation instructions: sudo apt-get install libsybdb5 freetds-dev freetds-common Please check the documentation, https://github.com/tds-fdw/tds_fdw/blob/master/InstallUbuntu.md, to ensure the install proceeds as normally.

fsando commented 4 years ago

Thank you. Unfortunately that gave me the error:

E: Unable to locate package libsysdb5

I apologize that I wasn't clear about that, apparently the libsysdb5 package is not available on ubuntu 18.10 or maybe I need to add a repository?

coolloud13 commented 4 years ago

Please advice. I am unable to move forward. I have tried executing MS SQL query from my REDHAT server and it is working but I am unable to create free_tds extension. Following error is displayed. SQL Error [XX000]: ERROR: could not load library "/home/postgres/PostgreSQL-10/lib/tds_fdw.so": libsybdb.so.5: cannot open shared object file: No such file or directory

[tds_fdw-master]# find / -name "libsybdb.so" /usr/local/lib/libsybdb.so /home/freetds-1.1.24/src/dblib/.libs/libsybdb.so

juliogonzalez commented 4 years ago

@fsando it seems to me your instance do not have access to the Ubuntu repositories:

root@e025f8f76c7a:/# apt-cache showpkg libsybdb5
Package: libsybdb5
Versions: 
1.00.82-2ubuntu0.1 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages.lz4) (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_bionic-security_main_binary-amd64_Packages.lz4)
 Description Language: 
                 File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_main_binary-amd64_Packages.lz4
                  MD5: 29f178ab4ec52996d65073243a0058bf
 Description Language: 
                 File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages.lz4
                  MD5: 29f178ab4ec52996d65073243a0058bf

1.00.82-2 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_main_binary-amd64_Packages.lz4)
 Description Language: 
                 File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_main_binary-amd64_Packages.lz4
                  MD5: 29f178ab4ec52996d65073243a0058bf
 Description Language: 
                 File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages.lz4
                  MD5: 29f178ab4ec52996d65073243a0058bf

As you can see, this is a package from main, so ensure you have main enabled at /etc/apt/sources.list

@coolloud13 your problem is complete different. In your case the package freetds is not installed. This is fron a CentOS6:

[postgres@dcb6d18c68fc /]$ rpm -qf /usr/lib64/libsybdb.so.5
freetds-0.91-2.el6.x86_64

Use FreeTDS from your distribution, and everything should work fine.

juliogonzalez commented 4 years ago

Any news here? @coolloud13? @fsando? Otherwise we should close the issue.

fsando commented 4 years ago

Sorry for the late response. A lot of things happened. You can close the issue.

To others: I solved it by adding the appropriate repository and it is now updated via apt - I am not sure which but it could be this one "https://packages.microsoft.com/ubuntu/18.04/prod bionic main"