RefLib

Reference library for AI

Back

postgresql_16:4.2.5.1 Shared Libraries

PostgreSQL 16 > Server Administration > Installation from Source Code > Post-Installation Setup > Shared Libraries

On some systems with shared libraries you need to tell the system how to find the newly installed shared libraries. The systems on which this is *not* necessary include FreeBSD, Linux, NetBSD, OpenBSD, and Solaris.

The method to set the shared library search path varies between platforms, but the most widely-used 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 (see configure). 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 this method can be found at http://xahlee.info/UnixResource_dir/_/ldpath.html.

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

On Cygwin, put the library directory in the PATH or move the .dll files into the bin directory.

If in doubt, refer to the manual pages of your system (perhaps ld.so or rld). If you later 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.

If you are on Linux and you have root access, you can run: /sbin/ldconfig /usr/local/pgsql/lib (or equivalent directory) after installation to enable the run-time linker to find the shared libraries faster. Refer to the manual page of ldconfig for more information. On FreeBSD, NetBSD, and OpenBSD the command is: /sbin/ldconfig -m /usr/local/pgsql/lib instead. Other systems are not known to have an equivalent command.

Back