Forum OpenACS Q&A: psql: relocation error: psql: undefined symbol: PQgetssl

Hello,

I'm not extremely good at administering/compiling stuff (main role as a web developer), however I'm getting the following error when trying to connect to my PostgreSQL db:

psql: relocation error: psql: undefined symbol: PQgetssl

This is the actual output:

[postgres@myhost pgsql]$ psql mytestdb
Welcome to psql 7.3.2, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
      \h for help with SQL commands
      \? for help on internal slash commands
      \g or terminate with semicolon to execute query
      \q to quit

psql: relocation error: psql: undefined symbol: PQgetssl
[postgres@myhost pgsql]$

I had gone through the installation instructions for OpenACS (actually trying to get dotlrn to work), but I think I got confused on the page where it actually has you create the config for AOLServer to run OpenACS.  So I tried to go back and figure out if I had done it right (I think I was using two users instead of the same one and the instructions weren't written like that 😊

I couldn't figure out how to log back into the PostgreSQL db (guess I forgot the user I used or something?) so I finally decided to delete the data dir and then run initdb again.  After all that, I just started down the instructions for PostgreSQL again, but when I got to connecting to see mytestdb, I got that error...

I then deleted the data directory again and did the ./configure, make and make install for PostgreSQL again.  And then I went ahead and just started from the beginning of the testing procedure.  However I got the error AGAIN when I got down there...  Everything before it worked just fine.  And I WAS able to do it previously.

I'm wondering if installing AOLServer changed things that could've messed it up.  I searched google to see what I could find and the only thing I could find was a suggestion to check the LD_LIBRARY_PATH, which is set right for the postgres user...  Any suggestions?

And I think the product is great, but man what I'd do to get Apache support 😉

Collapse
Posted by Jim Lynch on
psql: relocation error: psql: undefined symbol: PQgetssl

This is a "linker" error; the linker's job is to connect some executable to the libraries it uses. So, this error is related to binary files, i.e., something that has been compiled and linked. It is not related to scripts or configurations (except  possibly pre-compile source-configuration scripts).

My guess is that you have been trying repeatedly to get things to work, and not everything got rebuilt as you tried again under newer conditions.

The usual thing to do in a case like this is to delete all the binary files and rebuild the whole thing[1], but there is another possibility lurking:

You might also have several versions of postgres lying around, maybe one that was installed with your OS and the one you're trying to compile, at minimum. It could be that the psql you are trying to run is not the one for the version of postgres you are building (i.e., it's the wrong one). You should find out if this is the case[2], locate the correct binaries and arrange to search first for binaries there.

[1]
  make clean
  make

[2]
  which psql
  (-or-)
  whereis psql

Jim,

I appreciate the time invested in your reply and explanation.  Although I still don't grasp the concept as well as I'd like, you did help me identify the issue and get it resolved.  I've determined that I indeed have/had two versions of PostgreSQL installed on the system.  I had originally installed it during the RH9 install, but later "thought" I removed it and then reinstalled using the provided step-by-step instructions.

After I figured this out, it was considerably easier in getting the system functional.  In fact, I have a fully installed system waiting for me to begin testing on now, woohoo 😉

The only issue I'm having still is getting the auto-restart for AOLServer working correctly, specifically in attempting to get the inittab portion working (the restart-aolserver script works fine).  I'm still trying some things though, but might ask for assistance if our UNIX admin is too busy this week.  Thanks again for your help!

Collapse
Posted by Rajesh k on
hi ,

platform : redhat linux 9
-----------------------------------
I have tried using both the postgresql-7.3.2.tar.gz and  postgresql-7.3.6.tar.gz
I get the same error:

bash-2.05b$]$ createdb test
              CREATE DATABASE

bash-2.05b$]$ psql test
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
      \h for help with SQL commands
      \? for help on internal slash commands
      \g or terminate with semicolon to execute query
      \q to quit

psql: relocation error: psql: undefined symbol: PQgetssl

Can you please advise me what to do?

thanx,

I've just got same problem installing postgres 7.4.11 from source.

I've resolved it removing an old installation. Actually I had a postgres client (psql) of an older version. You have to be sure there is no previous installation of postgres server or clients.