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