Install PostgreSQL from Source on Linux
suggest changeDependencies:
- GNU Make Version > 3.80
- an ISO/ ANSI C-Compiler (e.g. gcc)
- an extractor like tar or gzip
- zlib-devel
- readline-devel or libedit-devel
Sources: PostgreSQL 9.6.3 source (not the current release)
Now you can extract the source files:
tar -xzvf postgresql-9.6.3.tar.gz
There are a large number of different options for the configuration of PostgreSQL:
Full Link to the full installation procedure
Small list of available options:
--prefix=PATHpath for all files--exec-prefix=PATHpath for architecture-dependent files--bindir=PATHpath for executable programs--sysconfdir=PATHpath for configuration files--with-pgport=NUMBERspecify a port for your server--with-perladd perl support--with-pythonadd python support--with-openssladd openssl support--with-ldapadd ldap support--with-blocksize=BLOCKSIZEset pagesize in KBBLOCKSIZEmust be a power of 2 between 1 and 32--with-wal-segsize=SEGSIZEset size of WAL-Segment size in MBSEGSIZEmust be a power of 2 between 1 and 64
Go into the newly created folder and run the configure script with the desired options. The install location is --prefix, not --exec:
./configure --prefix=/usr/local/pgsql
Run make to create the object files.
Run make install to install PostgreSQL from the built files.
Run make clean to tidy up.
For the extensions, switch to the contrib directory with cd contrib, then run make and make install.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents