From caf2eab6309f7cf6a1625c827582fe4fadc0b391 Mon Sep 17 00:00:00 2001 From: Stefan Walcz Date: Wed, 23 Sep 2026 07:49:44 +0200 Subject: [PATCH] fix(pgsql): pin pgvectorscale to a tagged release instead of main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building pgvectorscale from the moving main branch shipped an unreleased "0.9.2-dev" in the v0.6.5 image. Its control file carries upgrade scripts only between released versions (…, 0.9.0--0.9.1), none towards 0.9.2-dev. A database created with the v0.6.4 image (vectorscale 0.9.0) therefore fails on every diskann index access after the image bump: ERROR: could not access file "vectorscale-0.9.0": No such file or directory Searches on all collections silently return zero rows (HTTP 200), pg_dump aborts. Measured on a live store with 97 diskann indexes; rolling the image back to v0.6.4 restored everything without touching the volume. Pin the extension to a release tag (0.9.1 today), exactly as pg_textsearch is pinned a few lines above, so a rebuild cannot change the extension version by accident. Bumping the ARG stays a deliberate step, followed by ALTER EXTENSION vectorscale UPDATE on existing databases. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Stefan Walcz --- Dockerfile.pgsql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile.pgsql b/Dockerfile.pgsql index 4ea4a40..4da5404 100644 --- a/Dockerfile.pgsql +++ b/Dockerfile.pgsql @@ -81,9 +81,14 @@ ENV CARGO_TARGET_DIR="/tmp/cargo-target" # Build and install pgvectorscale extension (provides diskann access method) # Note: This may fail with SIGILL errors in some Docker environments due to Rust toolchain issues. # If this fails, pgvectorscale can be built separately and installed, or the system will fall back to pgvector. -# For production, use a specific version tag instead of main branch. +# Pin to a tagged release, for the same reason as pg_textsearch above: building from the +# moving main branch shipped an unreleased "0.9.2-dev" whose control file has no upgrade +# script from the 0.9.0 an existing database was created with. Every diskann index then +# fails with 'could not access file "vectorscale-0.9.0"', searches return empty and +# pg_dump aborts. Bump deliberately; run ALTER EXTENSION vectorscale UPDATE after a bump. +ARG PGVECTORSCALE_VERSION=0.9.1 RUN cd /tmp && \ - git clone --depth 1 https://github.com/timescale/pgvectorscale && \ + git clone --depth 1 --branch "${PGVECTORSCALE_VERSION}" https://github.com/timescale/pgvectorscale && \ cd pgvectorscale/pgvectorscale && \ PGRX_VERSION=$(cargo metadata --format-version 1 2>/dev/null | jq -r '.packages[] | select(.name == "pgrx") | .version' 2>/dev/null || \ grep -E 'pgrx\s*=\s*"' Cargo.toml | head -1 | sed -E 's/.*"([^"]+)".*/\1/' || echo "0.11.8") && \