Dependencies:
Sources: Link to the latest source (9.6.3)
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=PATH
path for all files--exec-prefix=PATH
path for architectur-dependet file--bindir=PATH
path for executable programs--sysconfdir=PATH
path for configuration files--with-pgport=NUMBER
specify a port for your server--with-perl
add perl support--with-python
add python support--with-openssl
add openssl support