Skip site navigation (1) Skip section navigation (2)

Re: psql undefined symbol error on Ubuntu

From: Michael Wood <esiotrot(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: psql undefined symbol error on Ubuntu
Date: 2009-07-09 15:20:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
I sent this directly to Harsha by mistake:


2009/7/8 Harsha Hegde <harsha(dot)hegde(at)vonage(dot)com>:
> Hello Friends,
> I have installed postgres client on an Ubuntu machine. However, when I
> try to run 'psql', I get this error message:
> # psql
> /usr/lib/postgresql/8.3/bin/psql: symbol lookup error:
> /usr/local/lib/ undefined symbol: PC

Google returns many results for the error
"/usr/local/lib/ undefined symbol: PC".  It is not
clear to me why so many people encounter this error, though.

By the way, why do you have a in /usr/local/lib?
Official Ubuntu packages are never installed to /usr/local.  I think
the problem is that psql is finding the wrong libreadline.

What does this give you:
ldd /usr/lib/postgresql/8.3/bin/psql

In order to get psql to use the correct libreadline, you have several options.
1.)  Remove the one from /usr/local/lib and then run "ldconfig", but
this might break other things.  Since it should not have been
installed there by official Ubuntu packages, I hope you know what it
is that needs it and can decide if this is a problem.  If you try
this, first rename it to something else and see what breaks.  Then you
can rename it back again if necessary.

2.)  Configure (or*) to ignore /usr/local/lib
(i.e. comment it out.  It should be in /etc/  Then
run "ldconfig".  This is similar to option 1.  i.e. it could break
other things, but should not break any official Ubuntu packages.

3.)  Configure (same files as for option 2) so that /lib and
/usr/lib are before /usr/local/lib when you run "ldconfig -v".  Not
sure about this, but you might just be able to put them above
/usr/local/lib in /etc/  This should be safe, but
keep a live CD handy in case.  Remember to run "ldconfig" after
changing the files.

4.)  Use LD_PRELOAD to force psql to use the correct libreadline.
This is the ugliest solution and you would have to do it every time
you run psql (or write a script that does this), so I don't recommend

LD_PRELOAD=/lib/ psql

also, I haven't tested it.  It won't break anything and I'm pretty
sure it will work, but as I said, it's ugly.

The best solution, I think, is number 1, but only if you don't
actually need the version in /usr/local for some reason.

I hope this helps and is not too confusing :)

Michael Wood <esiotrot(at)gmail(dot)com>

In response to


pgsql-novice by date

Next:From: Michael GouldDate: 2009-07-09 15:23:02
Subject: Setting up security for development
Previous:From: Michael WoodDate: 2009-07-09 15:18:21
Subject: Re: psql undefined symbol error on Ubuntu

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group