pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix pg_upgrade failure when extension_control_path is used
Date: Mon, 16 Mar 2026 10:56:24 +0000
Message-ID: <E1w25cW-0000L4-3B@gemulon.postgresql.org> (raw)

Fix pg_upgrade failure when extension_control_path is used

When an extension is located via extension_control_path and it has a
hardcoded $libdir/ path, this is stripped by the
extension_control_path mechanism.  But when pg_upgrade verifies the
extension using LOAD, this stripping does not happen, and so
pg_upgrade will fail because it cannot load the extension.  To work
around that, change pg_upgrade to itself strip the prefix when it runs
its checks.  A test case is also added.

Author: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
Reviewed-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/43b3691c673a8b9158f5a09f06eacc3c63e2c02d.camel%40gmail.co...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1e67508730eb0c98bf6eec660d0ed04368982266

Modified Files
--------------
src/bin/pg_upgrade/Makefile                        |   6 +-
src/bin/pg_upgrade/function.c                      |   8 ++
src/bin/pg_upgrade/meson.build                     |  21 +++-
src/bin/pg_upgrade/t/008_extension_control_path.pl | 126 +++++++++++++++++++++
src/test/modules/test_extensions/Makefile          |   3 +
src/test/modules/test_extensions/meson.build       |  13 +++
src/test/modules/test_extensions/test_ext.c        |  22 ++++
7 files changed, 197 insertions(+), 2 deletions(-)



Message-ID: <E1w25cW-0000L4-3B@gemulon.postgresql.org>
Permalink:  ../E1w25cW-0000L4-3B@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w25cW-0000L4-3B@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix pg_upgrade failure when extension_control_path is used
  In-Reply-To: <E1w25cW-0000L4-3B@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox