I am trying to execute pg_dump
on PostgreSQL 9.0.4 server running on Debian and I am getting the error below:
./pg_dump: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
libpq.so.5
is a link to libpq.so.5.3
as shown below
lrwxrwxrwx 1 root root 12 Jun 27 16:24 libpq.so.5 -> libpq.so.5.3 -rwxr-xr-x 1 root root 180749 Jun 21 02:43 libpq.so.5.3
What is it that I am doing wrong?
In which directory are these libpq
files? You can try setting environment variable LD_LIBRARY_PATH
to point to this directory or make sure it's in standard place.
Also, why isn't the libpq.so.5
link shown in the "as shown below" section? Maybe you should just run ldconfig
?
Try this:
1: Know the path of libpq.so.5
find / -name libpq.so.5
Output example: /usr/pgsql-9.4/lib/libpq.so.5
If found nothing, check if you have already installed the suitable postgresql-libs for your postgresql version and your OS platform
2: Symbolic link that library in a "well known" library path like /usr/lib
:
ln -s /usr/pgsql-9.4/lib/libpq.so.5 /usr/lib/libpq.so.5
Attention: If your platform is 64 bit, you MUST also symbolic link to 64 bit libraries path:
ln -s /usr/pgsql-9.4/lib/libpq.so.5 /usr/lib64/libpq.so.5
3: Be happy !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With