Skip to content

Commit f8d580d

Browse files
committed
chore: testing JG patch
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
1 parent d84d621 commit f8d580d

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ ARG PG_BRANCH=master
2626
ARG PG_MAJOR=19
2727

2828
COPY build-deps.txt /
29+
COPY pg_upgrade.patch /
2930

3031
ENV PATH=/usr/lib/postgresql/$PG_MAJOR/bin:$PATH
3132

@@ -55,6 +56,7 @@ RUN apt-get update && \
5556
mkdir -p /usr/src/postgresql && \
5657
git clone -b "$PG_BRANCH" --single-branch "$PG_REPO" /usr/src/postgresql && \
5758
cd /usr/src/postgresql && \
59+
git am pg_upgrade.patch && \
5860
export LLVM_CONFIG="/usr/lib/llvm-19/bin/llvm-config" && \
5961
export CLANG=clang-19 && \
6062
./configure \

pg_upgrade.patch

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From 39dea21ef1cb31928c6cda8f8da7ca3f0957bd9d Mon Sep 17 00:00:00 2001
2+
From: "Jonathan Gonzalez V." <jonathan.abdiel@gmail.com>
3+
Date: Mon, 23 Feb 2026 22:27:51 +0100
4+
Subject: [PATCH v1 1/1] Strip `$libdir` during pg_upgrade starting on 19.
5+
6+
With the commit 4f7f7b03758 extension_control_path GUC was included,
7+
while some test were added, is missing to handle the hardcoded `$libdir/`
8+
path during the execution of `pg_upgrade` for the the installed
9+
extensions using the extension_control_path GUC
10+
11+
Signed-off-by: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
12+
---
13+
src/bin/pg_upgrade/function.c | 9 +++++++++
14+
1 file changed, 9 insertions(+)
15+
16+
diff --git a/src/bin/pg_upgrade/function.c b/src/bin/pg_upgrade/function.c
17+
index 850c9238c11..5435024ccdb 100644
18+
--- a/src/bin/pg_upgrade/function.c
19+
+++ b/src/bin/pg_upgrade/function.c
20+
@@ -120,6 +120,15 @@ get_loadable_libraries(void)
21+
{
22+
char *lib = PQgetvalue(res, rowno, 0);
23+
24+
+ /*
25+
+ * Starting on version 18, the extension may be loaded using
26+
+ * extension_Control_path some extension have the `$libdir/`
27+
+ * hardcoded, we should remove it to allow the upgrade to version
28+
+ * 19 or above.
29+
+ */
30+
+ if (strncmp(lib, "$libdir/", 8) == 0)
31+
+ lib += 8;
32+
+
33+
os_info.libraries[totaltups].name = pg_strdup(lib);
34+
os_info.libraries[totaltups].dbnum = dbnum;
35+
36+
--
37+
2.51.0

0 commit comments

Comments
 (0)