From 128d7f919ddbd093ff54f1796bc739947cb26e91 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 16 Dec 2017 12:17:25 -0600 Subject: [PATCH] Use dpkg to compare postgresql versions for travis Otherwise PostgreSQL 10 doesn't get logical replication configured. --- travis/before_install.bash | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/travis/before_install.bash b/travis/before_install.bash index 7e7ed8fe..23c7d9cf 100755 --- a/travis/before_install.bash +++ b/travis/before_install.bash @@ -18,9 +18,11 @@ then echo "host replication pgx_replication 127.0.0.1/32 md5" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf echo "host pgx_test pgx_replication 127.0.0.1/32 md5" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf sudo chmod 777 /etc/postgresql/$PGVERSION/main/postgresql.conf - [[ $PGVERSION < 9.6 ]] || echo "wal_level='logical'" >> /etc/postgresql/$PGVERSION/main/postgresql.conf - [[ $PGVERSION < 9.6 ]] || echo "max_wal_senders=5" >> /etc/postgresql/$PGVERSION/main/postgresql.conf - [[ $PGVERSION < 9.6 ]] || echo "max_replication_slots=5" >> /etc/postgresql/$PGVERSION/main/postgresql.conf + if $(dpkg --compare-versions $PGVERSION ge 9.6) ; then + echo "wal_level='logical'" >> /etc/postgresql/$PGVERSION/main/postgresql.conf + echo "max_wal_senders=5" >> /etc/postgresql/$PGVERSION/main/postgresql.conf + echo "max_replication_slots=5" >> /etc/postgresql/$PGVERSION/main/postgresql.conf + fi sudo /etc/init.d/postgresql restart fi