Tuesday, April 12, 2022

[SOLVED] Getting symbol lookup error for psql while running psql command

Issue

I am getting issue as -

psql: symbol lookup error: psql: undefined symbol: PQsetErrorContextVisibility

I also followed the link - href="https://stackoverflow.com/q/52303275/14048308">psql: symbol lookup error: psql: undefined symbol: PQsetErrorContextVisibility

But was not able to solve that issue.

Command which I tried -

export LD_LIBRARY_PATH=/usr/pgsql_12/lib

And also looked for -

rpm -qa|grep postgresql
postgresql-libs-9.2.24-4.el7_8.x86_64
postgresql12-libs-12.3-5PGDG.rhel7.x86_64
postgresql11-libs-11.9-1PGDG.rhel7.x86_64
spacewalk-postgresql-clean-2.7.4-1.0.1.el7.noarch
postgresql12-contrib-12.3-5PGDG.rhel7.x86_64
postgresql12-12.3-5PGDG.rhel7.x86_64
postgresql12-devel-12.3-5PGDG.rhel7.x86_64
postgresql12-server-12.3-5PGDG.rhel7.x86_64

Can someone please help me with this? Thanks in advance!


Solution

This function was introduced in libpq in 9.5, so your psql from v12 must by mistake try to load the libpq from version 9.2, which causes this linker error.

You can try to change your shared library search path so that doesn't happen, but usually the better solution is to remove the 9.2 installation. The operating system packages and the PGDG packages don't work together well.



Answered By - Laurenz Albe
Answer Checked By - Candace Johnson (WPSolving Volunteer)