Fix pg_upgrade failure when extension_control_path is used

Peter Eisentraut <peter@eisentraut.org>

Commit: 1e67508730eb0c98bf6eec660d0ed04368982266
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2026-03-16T10:52:26Z
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.com

Files

Discussion