The use of the environment variables is not required. However, it is helpful when performing tasks within PostgreSQL including starting/shutting down the postmaster processes. The environment variables that should be set are for the shared library, man pages, and the bin directory. You can do so by adding the following statements into the /etc/profile file. This should work for any sh based shell, including BASH and KSH.

PATH=$PATH:/usr/local/pgsql/bin
MANPATH=$MANPATH:/usr/local/pgsql/man
export LD_LIBRARY_PATH PATH MANPATH

Depending on the type of Unix system you are running, you will want to add the PostgreSQL lib directory to the system linker path. On Linux systems this can be done by adding the following line to the /etc/ld.so.conf .

/usr/local/pgsql/lib