2
votes

I have installed postgres9.4 on Ubuntu
I used to be able to run psql just fine.

symbol lookup error: /usr/lib/postgressql/9.4/bin/psql: undefined symbol: PQhostaddr

As per Craig's comment I did a little digging.

I confirmed using ldd that PQhostaddr is the only exception.

I also tried this:

$ sudo ldconfig -v | grep libpq
/sbin/ldconfig.real: Path /lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path
/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.19.so is the dynamic linker, ignoring

libpq.so.5 -> libpq.so.5.7  

I can however only see the directories in each place once. (not repeated)
I also can't find libpq

So generally not doing amazingly with this. I would have assumed there was a method of updating libpq.so.5.7

Am I barking up the wrong tree? (Or just barking mad)

2
psql has nothing to do with psycopg2. Please give us the exact error psql gives you. We can't figure out what's happening with a just a phrase like "I can't seem to get it to run anymore"Jérôme Radix
Thanks Jerome - error in questionreabow
The libpq being found on the library path (/etc/ld.so.conf and LD_LIBRARY_PATH) is older than the version in 9.4. Use ldd /usr/lib/postgressql/9.4/bin/psql to find out which version is being linked to.Craig Ringer
Thanks Craig, that makes sense. I have libpq.so.5 being linked to. I looked in ld.so.conf, which includes ld.so.conf.d which is blank (that doesn't seem good). Also echo $LD_LIBRARY_PATH is also blank (although it is defined) - also not good. Thanks for bearing with mereabow
did you ever find a solution? I am having the same exact issue.Jared Mackey

2 Answers

1
votes

I had the same issue but I was able to resolve it by completely removing postgresql with these commands.

apt-get --purge remove postgresql\*
 rm -r /etc/postgresql/
 rm -r /etc/postgresql-common/
 rm -r /var/lib/postgresql/
 userdel -r postgres
 groupdel postgres

Then reinstalling postgresql.

0
votes

Worked for me: removed completely and reinstalled PostgreSQL packages (but the cluster)