Supported Versions: Current (17) / 16 / 15 / 14 / 13
Development Versions: devel
Unsupported versions: 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4 / 7.3 / 7.2 / 7.1
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

1.6. Post-Installation Setup

1.6.1. Shared Libraries

On some systems that have shared libraries (which most systems do) you need to tell your system how to find the newly installed shared libraries. The systems on which this is not necessary include FreeBSD, HP/UX, Irix, Linux, NetBSD, OpenBSD, OSF/1 (Digital Unix, Tru64 UNIX), and Solaris.

The method to set the shared library search path varies between platforms, but the most widely usable method is to set the environment variable LD_LIBRARY_PATH like so: In Bourne shells (sh, ksh, bash, zsh)

LD_LIBRARY_PATH=/usr/local/pgsql/lib
export LD_LIBRARY_PATH
or in csh or tcsh
setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
Replace /usr/local/pgsql/lib with whatever you set --libdir to in step 1. You should put these commands into a shell start-up file such as /etc/profile or ~/.bash_profile. Some good information about the caveats associated with the method can be found at http://www.visi.com/~barr/ldpath.html.

On some systems it might be preferable to set the environment variable LD_RUN_PATH before building.

If in doubt, refer to the manual pages of your system (perhaps ld.so or rld). If you later on get a message like

psql: error in loading shared libraries
libpq.so.2.1: cannot open shared object file: No such file or directory
then this step was necessary. Simply take care of it then.

1.6.2. Environment Variables

If you installed into /usr/local/pgsql or some other location that is not searched for programs by default, you need to add /usr/local/pgsql/bin (or what you set --bindir to in step 1) into your PATH. To do this, add the following to your shell start-up file, such as ~/.bash_profile (or /etc/profile, if you want it to affect every user):

PATH=$PATH:/usr/local/pgsql/bin
If you are using csh or tcsh, then use this command:
set path = ( /usr/local/pgsql/bin $path )

To enable your system to find the man documentation, you need to add a line like the following to a shell start-up file:

MANPATH=$MANPATH:/usr/local/pgsql/man

The environment variables PGHOST and PGPORT specify to client applications the host and port of the database server, overriding the compiled-in defaults. If you are going to run client applications remotely then it is convenient if every user that plans to use the database sets PGHOST, but it is not required and the settings can be communicated via command line options to most client programs.