This page in other versions: 0.9 / 1.0.3

3.3. Installing BDR from source

3.3.1. Prerequisites for installing from source

To install BDR the prerequisites for compiling PostgreSQL must be installed. These are described in PostgreSQL's documentation on build requirements and build requirements for documentation.

On several systems the prerequisites for compiling PostgreSQL and BDR can be installed using simple commands.

3.3.2. Getting BDR source code

There are two ways to get the BDR source code: with git, or by downloading tarballs of released versions. Using git to get the BDR sources

Use git if you expect to update often, you want to keep track of development or if you want to contribute changes to BDR. There is no reason not to use git if you're familiar with it.

Instructions for getting the sources can be found at

For more information on using git see Downloading release source tarballs

Official BDR release source code is uploaded as tarballs to the BDR website along with a tarball checksum and a matching GnuPG signature. See for the download information. See Verifying digital signatures for information on verifying digital signatures.

You will need to download both the patched PostgreSQL source (postgresql-bdr-[...].tar.gz) and the associated BDR release (bdr-[...].tar.gz).

You may optionally verify the package checksums from the .md5 files and/or verify the GnuPG signatures per Verifying digital signatures.

After you unpack the source code archives using tar xf the installation process is the same as if you were installing from a git clone.

3.3.3. Installation of BDR from source

Installing BDR from source consists out of two steps: First compile and install PostgreSQL with the BDR additions; secondly compile and install the BDR plugin.

The patched PostgreSQL required for BDR can be compiled using the normal documented procedures. That will usually be something like:

    cd /path/to/bdr-pg-source/
    ./configure --prefix=/path/to/install --enable-debug --with-openssl
    make -j4 -s install-world

To then install BDR execute its configure script with the pg_config installed by the patched PostgreSQL in the PATH environment variable, e.g.:

    cd /path/to/bdr-plugin-source/
    PATH=/path/to/postgres/install/bin:"$PATH" ./configure
    make -j4 -s all
    make -s install