Merge pull request #363 from jackc/fix-travis-pg-10

Use dpkg to compare postgresql versions for travis
pull/359/merge
Jack Christensen 2017-12-16 12:44:37 -06:00 committed by GitHub
commit 1ed4024c70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -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