Skip to content

Commit d2e90d4

Browse files
committed
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)
1 parent c0019b3 commit d2e90d4

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
ARG PG_VERSION=17
55
ARG PGVECTOR_VERSION=0.8.0
66
ARG POSTGIS_VERSION=3.5.1
7-
ARG PG_TEXTSEARCH_VERSION=0.2.0
7+
# Pin to main branch commit that includes the ResourceOwnerEnlarge crash fix (PR #248)
8+
# No tagged release includes this fix yet (latest release is v0.5.1)
9+
ARG PG_TEXTSEARCH_COMMIT=ae1c221
810
ARG PGSODIUM_VERSION=3.1.9
911

1012
#############################################
@@ -14,7 +16,7 @@ FROM postgres:${PG_VERSION}-alpine AS builder
1416

1517
ARG PGVECTOR_VERSION
1618
ARG POSTGIS_VERSION
17-
ARG PG_TEXTSEARCH_VERSION
19+
ARG PG_TEXTSEARCH_COMMIT
1820
ARG PGSODIUM_VERSION
1921

2022
RUN apk add --no-cache \
@@ -57,10 +59,12 @@ RUN curl -L https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION}
5759
make install
5860

5961
# pg_textsearch (BM25)
60-
RUN git clone --branch v${PG_TEXTSEARCH_VERSION} --depth 1 https://github.com/timescale/pg_textsearch.git && \
62+
# Build from main at a specific commit to include the temp-table/transaction
63+
# crash fix (PR #248, issue #247: ResourceOwnerEnlarge on rollback).
64+
# The math.h workaround is no longer needed (fixed upstream in v0.3.0).
65+
RUN git clone https://github.com/timescale/pg_textsearch.git && \
6166
cd pg_textsearch && \
62-
# Fix missing math.h include (upstream bug)
63-
sed -i '1i #include <math.h>' src/am/build.c && \
67+
git checkout ${PG_TEXTSEARCH_COMMIT} && \
6468
make -j$(nproc) && \
6569
make install
6670

0 commit comments

Comments
 (0)