From d2e90d454675be8b595dd6dff9281422f362ee85 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 4 Mar 2026 19:18:38 +0000 Subject: [PATCH 1/2] fix: upgrade pg_textsearch from v0.2.0 to main@ae1c221 (crash fix) Upgrades pg_textsearch to include the ResourceOwnerEnlarge crash fix from PR #248 (issue #247). The crash occurs when a BM25 index scan runs inside a transaction that is rolled back. Changes: - Pin pg_textsearch to commit ae1c221 on main (no tagged release includes the fix yet; latest release is v0.5.1) - Remove the math.h sed workaround (fixed upstream in v0.3.0) - Clone full repo instead of shallow tag clone (needed for commit checkout) --- Dockerfile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index d53bb38..2e023c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,9 @@ ARG PG_VERSION=17 ARG PGVECTOR_VERSION=0.8.0 ARG POSTGIS_VERSION=3.5.1 -ARG PG_TEXTSEARCH_VERSION=0.2.0 +# Pin to main branch commit that includes the ResourceOwnerEnlarge crash fix (PR #248) +# No tagged release includes this fix yet (latest release is v0.5.1) +ARG PG_TEXTSEARCH_COMMIT=ae1c221 ARG PGSODIUM_VERSION=3.1.9 ############################################# @@ -14,7 +16,7 @@ FROM postgres:${PG_VERSION}-alpine AS builder ARG PGVECTOR_VERSION ARG POSTGIS_VERSION -ARG PG_TEXTSEARCH_VERSION +ARG PG_TEXTSEARCH_COMMIT ARG PGSODIUM_VERSION RUN apk add --no-cache \ @@ -57,10 +59,12 @@ RUN curl -L https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION} make install # pg_textsearch (BM25) -RUN git clone --branch v${PG_TEXTSEARCH_VERSION} --depth 1 https://github.com/timescale/pg_textsearch.git && \ +# Build from main at a specific commit to include the temp-table/transaction +# crash fix (PR #248, issue #247: ResourceOwnerEnlarge on rollback). +# The math.h workaround is no longer needed (fixed upstream in v0.3.0). +RUN git clone https://github.com/timescale/pg_textsearch.git && \ cd pg_textsearch && \ - # Fix missing math.h include (upstream bug) - sed -i '1i #include ' src/am/build.c && \ + git checkout ${PG_TEXTSEARCH_COMMIT} && \ make -j$(nproc) && \ make install From 17eca8df653dde69708815068d488185a207fc5e Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 4 Mar 2026 12:14:10 -0800 Subject: [PATCH 2/2] upgrades --- Dockerfile | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2e023c3..bff14b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,7 @@ ARG PG_VERSION=17 ARG PGVECTOR_VERSION=0.8.0 ARG POSTGIS_VERSION=3.5.1 -# Pin to main branch commit that includes the ResourceOwnerEnlarge crash fix (PR #248) -# No tagged release includes this fix yet (latest release is v0.5.1) -ARG PG_TEXTSEARCH_COMMIT=ae1c221 +ARG PG_TEXTSEARCH_VERSION=0.6.0 ARG PGSODIUM_VERSION=3.1.9 ############################################# @@ -16,7 +14,7 @@ FROM postgres:${PG_VERSION}-alpine AS builder ARG PGVECTOR_VERSION ARG POSTGIS_VERSION -ARG PG_TEXTSEARCH_COMMIT +ARG PG_TEXTSEARCH_VERSION ARG PGSODIUM_VERSION RUN apk add --no-cache \ @@ -59,12 +57,8 @@ RUN curl -L https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION} make install # pg_textsearch (BM25) -# Build from main at a specific commit to include the temp-table/transaction -# crash fix (PR #248, issue #247: ResourceOwnerEnlarge on rollback). -# The math.h workaround is no longer needed (fixed upstream in v0.3.0). -RUN git clone https://github.com/timescale/pg_textsearch.git && \ +RUN git clone --branch v${PG_TEXTSEARCH_VERSION} --depth 1 https://github.com/timescale/pg_textsearch.git && \ cd pg_textsearch && \ - git checkout ${PG_TEXTSEARCH_COMMIT} && \ make -j$(nproc) && \ make install