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.2. Requirements

In general, a modern Unix-compatible platform should be able to run PostgreSQL. The platforms that had received specific testing at the time of release are listed in Section 1.7 below. In the doc subdirectory of the distribution there are several platform-specific FAQ documents you might wish to consult if you are having trouble.

The following software packages are required for building PostgreSQL:

  • GNU make is required; other make programs will not work. GNU make is often installed under the name gmake; this document will always refer to it by that name. (On some systems GNU make is the default tool with the name make.) To test for GNU make enter

    gmake --version
    

    It is recommended to use version 3.76.1 or later.

  • You need an ISO/ANSI C compiler. Recent versions of GCC are recommendable, but PostgreSQL is known to build with a wide variety of compilers from different vendors.

  • gzip is needed to unpack the distribution in the first place. If you are reading this, you probably already got past that hurdle.

  • The GNU Readline library (for comfortable line editing and command history retrieval) will be used by default. If you don't want to use it then you must specify the --without-readline option for configure. (On NetBSD, the libedit library is readline-compatible and is used if libreadline is not found.)

  • To build on Windows NT or Windows 2000 you need the Cygwin and cygipc packages. See the file doc/FAQ_MSWIN for details.

The following packages are optional. They are not required in the default configuration, but they are needed when certain build options are enabled, as explained below.

  • To build the server programming language PL/Perl you need a full Perl installation, including the libperl library and the header files. Since PL/Perl will be a shared library, the libperl library must be a shared library also on most platforms. This appears to be the default in recent Perl versions, but it was not in earlier versions, and in general it is the choice of whomever installed Perl at your site.

    If you don't have the shared library but you need one, a message like this will appear during the build to point out this fact:

    *** Cannot build PL/Perl because libperl is not a shared library.
    *** You might have to rebuild your Perl installation.  Refer to
    *** the documentation for details.
    

    (If you don't follow the on-screen output you will merely notice that the PL/Perl library object, plperl.so or similar, will not be installed.) If you see this, you will have to rebuild and install Perl manually to be able to build PL/Perl. During the configuration process for Perl, request a shared library.

  • To build the Python interface module or the PL/Python server programming language, you need a Python installation, including the header files. Since PL/Python will be a shared library, the libpython library must be a shared library also on most platforms. This is not the case in a default Python installation.

    If after building and installing you have a file called plpython.so (possibly a different extension), then everything went well. Otherwise you should have seen a notice like this flying by:

    *** Cannot build PL/Python because libpython is not a shared library.
    *** You might have to rebuild your Python installation.  Refer to
    *** the documentation for details.
    

    That means you have to rebuild (part of) your Python installation to supply this shared library.

    The catch is that the Python distribution or the Python maintainers do not provide any direct way to do this. The closest thing we can offer you is the information in Python FAQ 3.30. On some operating systems you don't really have to build a shared library, but then you will have to convince the PostgreSQL build system of this. Consult the Makefile in the src/pl/plpython directory for details.

  • If you want to build Tcl or Tk components (clients and the PL/Tcl language) you of course need a Tcl installation.

  • To build the JDBC driver, you need Ant 1.5 or higher and a JDK. Ant is a special tool for building Java-based packages. It can be downloaded from the Ant web site.

    If you have several Java compilers installed, it depends on the Ant configuration which one gets used. Precompiled Ant distributions are typically set up to read a file .antrc in the current user's home directory for configuration. For example, to use a different JDK than the default, this may work:

    JAVA_HOME=/usr/local/sun-jdk1.3
    JAVACMD=$JAVA_HOME/bin/java
    

    Note: Do not try to build the driver by calling ant or even javac directly. This will not work. Run gmake normally as described below.

  • To enable Native Language Support (NLS), that is, the ability to display a program's messages in a language other than English, you need an implementation of the Gettext API. Some operating systems have this built-in (e.g., Linux, NetBSD, Solaris), for other systems you can download an add-on package from here: http://www.postgresql.org/~petere/gettext.html. If you are using the gettext implementation in the GNU C library then you will additionally need the GNU Gettext package for some utility programs. For any of the other implementations you will not need it.

  • Kerberos, OpenSSL, or PAM, if you want to support authentication using these services.

If you are build from a CVS tree instead of using a released source package, or if you want to do development, you also need the following packages:

  • Flex and Bison are needed to build a CVS checkout or if you changed the actual scanner and parser definition files. If you need them, be sure to get Flex 2.5.4 or later and Bison 1.50 or later. Other yacc programs can sometimes be used, but doing so requires extra effort and is not recommended. Other lex programs will definitely not work.

If you need to get a GNU package, you can find it at your local GNU mirror site (see http://www.gnu.org/order/ftp.html for a list) or at ftp://ftp.gnu.org/gnu/.

Also check that you have sufficient disk space. You will need about 65 MB for the source tree during compilation and about 15 MB for the installation directory. An empty database cluster takes about 25 MB, databases take about five times the amount of space that a flat text file with the same data would take. If you are going to run the regression tests you will temporarily need up to an extra 90 MB. Use the df command to check for disk space.