The error means that the 'psql' utility is searching for the library file 'libpq.so.5' and does not know in which folder to find it. 'psql' uses the environment variable 'LD_LIBRARY_PATH' to determine which folders to search in, and so you will need to set this variable to the correct folder.
The steps to resolve this are below:
(1) Go to the <TDV_INSTALL>/repository/lib folder as shown in the example below.
# cd /opt/TIBCO/TDV_Server/repository/lib
(2) Check that the file "libpq.so.5" is present here(Location:
/opt/TIBCO/TDV_Server_8.x/repository/lib) using the command:
# ls -ltr
(3) Set the LD_LIBRARY_PATH env. variable to the folder as in the example below.
# echo $LD_LIBRARY_PATH
==> if this displays an empty result instead of displaying a path, run:
# export /opt/TIBCO/TDV_Server_8.x/repository/lib
==> if this displays a path, you can use this (it will append to the path) :
# export LD_LIBRARY_PATH= /opt/TIBCO/TDV_Server_8.x/repository/lib:$LD_LIBRARY_PATH
(5) Run the 'psql' command.