Try to put these two lines on the /etc/profile:
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/local/pgsql/lib
export LD_LIBRARY_PATH
Mario "Mago" Haza
Technological Research / Research Center for Educational Computing
e-mail: mhaza(at)tajin(dot)cice(dot)mx
mhaza(at)www(dot)dcc(dot)anahuac(dot)mx
Tel. (5) 627-0210 Ext. 8530 or 8527 (Mexico City)