diff --git a/docker/ci/setup.sh b/docker/ci/setup.sh index 701757d1..1e9e478d 100755 --- a/docker/ci/setup.sh +++ b/docker/ci/setup.sh @@ -252,13 +252,19 @@ cargo install cargo-pgrx --version =$PGRX_VERSION # Configure pgrx ## `cargo pgrx init` is not additive; must specify all versions in one command. -for pg in $PG_VERSIONS; do - init_flags="$init_flags --pg$pg $PG_BASE$pg/bin/pg_config" -done +for pg_config in $(find /usr -name 'pg_config' -type f | grep "${PG_BASE}"); do + pg="$(${pg_config} --version | awk -F '[ .]' '{print $2'})" + init_flags="$init_flags --pg$pg ${pg_config}" cargo pgrx init $init_flags -## Initialize pgrx-managed databases so we can add the timescaledb load. -for pg in $TSDB_PG_VERSIONS; do - echo "shared_preload_libraries = 'timescaledb'" >> ~/.pgrx/data-$pg/postgresql.conf + +## Initialize pgrx-managed databases so we can add the timescaledb load, but only +## for those PostgreSQL versions that have the timescaledb.so library available. +for pg_config in $(find /usr -name 'pg_config' -type f | grep "${PG_BASE}"); do + pg="$(${pg_config} --version | awk -F '[ .]' '{print $2'})" + lib="$(find "${PGBASE}${pg}" -type f -name 'timescaledb.so')" + if [ "${lib}" != "" ]; then + echo "shared_preload_libraries = 'timescaledb'" >> ~/.pgrx/data-$pg/postgresql.conf + fi done # Clone and fetch dependencies so we builds have less work to do.