It is possible to build Slony 1.2.23 against EnterpriseDB but the use of slonik will fail. The patch has been done put on branch Slony 2.X not in Slony 1.2.X. Here we will see how to compile Slony 1.2.23 against EnterpriseDB 8.3.0.112.

1. Binaries: Download / Installation

VersionDownload
Linux 32 Bitshttp://www.davidgis.fr/download/EDB830112_Slony-1.2.23_linux-x86.tar.bz2'
Linux 64 Bitshttp://www.davidgis.fr/download/EDB830112_Slony-1.2.23_linux-x86-64.tar.bz2'
    IMPORTANT: KEEP IN MIND THAT MY GOAL IS NOT TO REPLACE THE SLONY'S BINARIES 1.2.11 BUNDLED WITH ENTERPRISEDB 8.3.0.112. SINCE ENTERPRISEDB IS NOT RESPONSIBLE/ DOES NOT SUPPORT FOR THE USE OF SLONY 1.2.23, I'VE DECIDED TO CHOICE A "HARDCODED" PATH FOR SLONY 1.2.23: /opt/slony/1.2.23. IT IMPLIES THAT SLONY'S BINARIES 1.2.11 WILL NOT BE REPLACED :)
  • Download the required file
    # 32 Bits
    wget -q http://www.davidgis.fr/download/EDB830112_Slony-1.2.23_linux-x86.tar.bz2
    # 64 bits
    wget -q http://www.davidgis.fr/download/EDB830112_Slony-1.2.23_linux-x86-64.tar.bz2
  • (As root), decompress to '/'
    # 32 Bits
    tar xjf EDB830112_Slony-1.2.23_linux-x86.tar.bz2 -C /
    # 64 bits
    tar xjf http://www.davidgis.fr/download/EDB830112_Slony-1.2.23_linux-x86-64.tar.bz2 -C /
slonik and slon are located to /opt/slony/1.2.23/bin. The required libraries are located to /opt/slony/1.2.23/lib

How to compile yourself

  1. As root, be sure to have all the prerequisites
    apt-get install build-essential perl bison flex
  2. As root, we are going to create a (temporary) symbolic link
    mkdir -pv /opt/slony-1.2.23
    ln -s /opt/PostgresPlus/8.3R2AS/dbserver/lib /opt/slony-1.2.23/lib
  3. As enterprisedb, download the last Slony's sources from branch 1.2
    wget "http://git.postgresql.org/gitweb/?p=slony1-engine.git;a=snapshot;h=af01af7786f0f4f6c5c5ea991200be04a431f586;sf=tgz" -O - | tar xvzf -
    cd slony1-engine-af01af7/
  4. As enterprisedb, apply the patch to build SLony against EnterpriseDB 8.3.0.112
    cd ~/slony1-engine-af01af7/
    wget http://www.davidgis.fr/download/patch_EnterpriseDB.patch  -O - | patch -p1
    Notice: the required patch could be found at Slony's Git Repository (http://git.postgresql.org/gitweb/?p=slony1-engine.git;a=commit;h=32728b33d460d650445b89281d134e33958fde34 It has been submitted by Mark Mielke (http://lists.slony.info/pipermail/slony1-general/2011-May/011681.html)
  5. As enterprisedb, configure Slony
    ./configure \
    --prefix=/opt/slony-1.2.23 \
    --with-pgconfigdir=/opt/PostgresPlus/8.3R2AS/dbserver/bin/ \
    --with-perlsharedir=/opt/slony-1.2.23/lib \
    --with-pgsharedir=/opt/slony-1.2.23/share \
    --with-perltools=/opt/slony-1.2.23/scripts \
    --with-pglibdir=/opt/slony-1.2.23/lib \
    --with-pgpkglibdir=/opt/slony-1.2.23/lib
    Replace now '$libdir' by the harcoded path '/opt/slony-1.2.23/lib'
    grep -lriE '\$libdir' . | while read file;do sed -i 's:\$libdir:/opt/slony-1.2.23/lib:g' $file;done
    Compile
    make
  6. As root, delete the symbolic link
    rm -rf /opt/slony-1.2.23
    Install Slony
    cd ~enterprisedb/slony1-engine-af01af7
    make install
    Put the required rights on '/opt/slony', something like
    chmod 777 -R /opt/slony