Compile and Install from source code

From PostgreSQL wiki

Jump to: navigation, search

A set of instructions for building Postgres from a source archive.

Contents

Acquire the source code

From postgresql.org

The source code can be found at git.postgresql.org or in the main file browser.

From GitHub

The mirror of Postgres on GitHub provides a "Download ZIP" option.

Build+install the source code

Detailed instructions can be found in the documentation.

Red Hat requirements

The following packages are needed for building Postgres with SSL support:

sudo yum install -y bison-devel readline-devel zlib-devel openssl-devel wget
sudo yum groupinstall -y 'Development Tools'

Ubuntu requirements

The following packages are needed for building Postgres with including SSL support:

sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev
Personal tools