17.1. Requirements#
In general, a modern Unix-compatible platform should be able to runPostgreSQL. The platforms that had received specific testing at the time of release are described inSection 17.6 below.
The following software packages are required for buildingPostgreSQL:
GNUmake version 3.81 or newer is required; othermake programs or olderGNUmake versions willnot work. (GNUmake is sometimes installed under the name
gmake
.) To test forGNUmake enter:make --version
Alternatively,PostgreSQL can be built usingMeson. This is currently experimental. If you choose to useMeson, then you don't needGNUmake, but the other requirements below still apply.
The minimum required version ofMeson is 0.54.
You need anISO/ANSI C compiler (at least C99-compliant). Recent versions ofGCC are recommended, butPostgreSQL is known to build using a wide variety of compilers from different vendors.
tar is required to unpack the source distribution, in addition to eithergzip orbzip2.
Flex 2.5.35 or later andBison 2.3 or later are required. Otherlex andyacc programs cannot be used.
Perl 5.14 or later is needed during the build process and to run some test suites. (This requirement is separate from the requirements for buildingPL/Perl; see below.)
TheGNUReadline library is used by default. It allowspsql (the PostgreSQL command line SQL interpreter) to remember each command you type, and allows you to use arrow keys to recall and edit previous commands. This is very helpful and is strongly recommended. If you don't want to use it then you must specify the
--without-readline
option toconfigure
. As an alternative, you can often use the BSD-licensedlibedit
library, originally developed onNetBSD. Thelibedit
library is GNUReadline-compatible and is used iflibreadline
is not found, or if--with-libedit-preferred
is used as an option toconfigure
. If you are using a package-based Linux distribution, be aware that you need both thereadline
andreadline-devel
packages, if those are separate in your distribution.Thezlib compression library is used by default. If you don't want to use it then you must specify the
--without-zlib
option toconfigure
. Using this option disables support for compressed archives inpg_dump andpg_restore.The ICU library is used by default. If you don't want to use it then you must specify the
--without-icu
option toconfigure
. Using this option disables support for ICU collation features (seeSection 23.2).ICU support requires theICU4C package to be installed. The minimum required version ofICU4C is currently 4.2.
By default,pkg-config will be used to find the required compilation options. This is supported forICU4C version 4.6 and later. For older versions, or ifpkg-config is not available, the variables
ICU_CFLAGS
andICU_LIBS
can be specified toconfigure
, like in this example:./configure ... ICU_CFLAGS='-I/some/where/include' ICU_LIBS='-L/some/where/lib -licui18n -licuuc -licudata'
(IfICU4C is in the default search path for the compiler, then you still need to specify nonempty strings in order to avoid use ofpkg-config, for example,
ICU_CFLAGS=' '
.)
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 languagePL/Perl you need a fullPerl installation, including the
libperl
library and the header files. The minimum required version isPerl 5.14. SincePL/Perl will be a shared library, thelibperl
library must be a shared library also on most platforms. This appears to be the default in recentPerl versions, but it was not in earlier versions, and in any case it is the choice of whomever installed Perl at your site.configure
will fail if buildingPL/Perl is selected but it cannot find a sharedlibperl
. In that case, you will have to rebuild and installPerl manually to be able to buildPL/Perl. During the configuration process forPerl, request a shared library.If you intend to make more than incidental use ofPL/Perl, you should ensure that thePerl installation was built with the
usemultiplicity
option enabled (perl -V
will show whether this is the case).To build thePL/Python server programming language, you need aPython installation with the header files and thesysconfig module. The minimum required version isPython 3.2.
SincePL/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 defaultPython installation built from source, but a shared library is available in many operating system distributions.configure
will fail if buildingPL/Python is selected but it cannot find a sharedlibpython
. That might mean that you either have to install additional packages or rebuild (part of) yourPython installation to provide this shared library. When building from source, runPython's configure with the--enable-shared
flag.To build thePL/Tcl procedural language, you of course need aTcl installation. The minimum required version isTcl 8.4.
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 theGettextAPI. Some operating systems have this built-in (e.g.,Linux,NetBSD,Solaris), for other systems you can download an add-on package fromhttps://www.gnu.org/software/gettext/. If you are using theGettext implementation in theGNU C library, then you will additionally need theGNU Gettext package for some utility programs. For any of the other implementations you will not need it.
You needOpenSSL, if you want to support encrypted client connections.OpenSSL is also required for random number generation on platforms that do not have
/dev/urandom
(except Windows). The minimum required version is 1.0.2.You needMIT Kerberos (for GSSAPI),OpenLDAP, and/orPAM, if you want to support authentication using those services.
You needLZ4, if you want to support compression of data with that method; seedefault_toast_compression andwal_compression.
You needZstandard, if you want to support compression of data with that method; seewal_compression. The minimum required version is 1.4.0.
To build thePostgreSQL documentation, there is a separate set of requirements; seeSection J.2.
If you need to get aGNU package, you can find it at your localGNU mirror site (seehttps://www.gnu.org/prep/ftp for a list) or atftp://ftp.gnu.org/gnu/.