Skip to content

Commit

Permalink
Only install the latest compatible version of timescaledb (#1046)
Browse files Browse the repository at this point in the history
Co-authored-by: Polina Bungina <27892524+hughcapet@users.noreply.github.com>
  • Loading branch information
idanovinda and hughcapet authored Nov 11, 2024
1 parent d07ca8c commit bfc3d54
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions postgres-appliance/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG BASE_IMAGE=ubuntu:22.04
ARG PGVERSION=17
ARG TIMESCALEDB="2.15.3 2.17.2"
ARG DEMO=false
ARG COMPRESS=false
ARG ADDITIONAL_LOCALES=
Expand Down Expand Up @@ -43,6 +44,7 @@ COPY build_scripts/base.sh /builddeps/
COPY --from=dependencies-builder /builddeps/*.deb /builddeps/

ARG PGVERSION
ARG TIMESCALEDB
ARG TIMESCALEDB_APACHE_ONLY=true
ARG TIMESCALEDB_TOOLKIT=true
ARG COMPRESS
Expand Down
13 changes: 13 additions & 0 deletions postgres-appliance/build_scripts/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
"postgresql-${version}-pg-stat-kcache" \
"${EXTRAS[@]}"

# Clean up timescaledb versions except the highest compatible version
exclude_patterns=()
exclude_patterns_tsl=()
for ts_version in ${TIMESCALEDB}; do
exclude_patterns+=(! -name timescaledb-"${ts_version}".so)
exclude_patterns_tsl+=(! -name timescaledb-tsl-"${ts_version}".so)
done
find /usr/lib/postgresql/"${version}"/lib/ -name 'timescaledb-2.*.so' "${exclude_patterns[@]}" -delete;

if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ]; then
find /usr/lib/postgresql/"${version}"/lib/ -name 'timescaledb-tsl-2.*.so' "${exclude_patterns_tsl[@]}" -delete;
fi

# Install 3rd party stuff

if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ] && [ "${TIMESCALEDB_TOOLKIT}" = "true" ]; then
Expand Down

0 comments on commit bfc3d54

Please sign in to comment.