Fix pg_upgrade failure when extension_control_path is used
Peter Eisentraut <peter@eisentraut.org>
Author:
Peter Eisentraut <peter@eisentraut.org>
Date: 2026-03-16T10:52:26Z
Releases:
19 (unreleased)
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
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_upgrade/function.c | modified | +8 −0 |
| src/bin/pg_upgrade/Makefile | modified | +5 −1 |
| src/bin/pg_upgrade/meson.build | modified | +20 −1 |
| src/bin/pg_upgrade/t/008_extension_control_path.pl | added | +126 −0 |
| src/test/modules/test_extensions/Makefile | modified | +3 −0 |
| src/test/modules/test_extensions/meson.build | modified | +13 −0 |
| src/test/modules/test_extensions/test_ext.c | added | +22 −0 |
Discussion
- pg_upgrade fails when extension_control_path is used 7 messages · 2026-03-03 → 2026-03-16