From c38bbd9cc65062218e87159caeae27352c43a69a Mon Sep 17 00:00:00 2001 From: idanovinda Date: Fri, 8 Nov 2024 16:28:18 +0100 Subject: [PATCH] Only install the latest compatible version of timescaledb --- postgres-appliance/build_scripts/base.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/postgres-appliance/build_scripts/base.sh b/postgres-appliance/build_scripts/base.sh index 201b0776..b06f256b 100644 --- a/postgres-appliance/build_scripts/base.sh +++ b/postgres-appliance/build_scripts/base.sh @@ -124,6 +124,15 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do "postgresql-${version}-pg-stat-kcache" \ "${EXTRAS[@]}" + # Clean up timescaledb versions except the highest compatible version + highest_version=$(find /usr/lib/postgresql/"${version}"/lib/timescaledb-2.*.so | sort -V | tail -n 1) + find /usr/lib/postgresql/"${version}"/lib/ -name 'timescaledb-2.*.so' ! -path "${highest_version}" -exec rm -f {} \; + + if [ "${TIMESCALEDB_APACHE_ONLY}" = "false" ]; then + highest_version_tsl=$(find /usr/lib/postgresql/"${version}"/lib/timescaledb-tsl-2.*.so | sort -V | tail -n 1) + find /usr/lib/postgresql/"${version}"/lib/ -name 'timescaledb-tsl-2.*.so' ! -path "${highest_version_tsl}" -exec rm -f {} \; + fi + # Install 3rd party stuff if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ] && [ "${TIMESCALEDB_TOOLKIT}" = "true" ]; then