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. <[email protected]>
Reviewed-by: Niccolò Fei <[email protected]>
Reviewed-by: Matheus Alcantara <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/flat/43b3691c673a8b9158f5a09f06eacc3c63e2c02d.camel%40gmail.com

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(-)

Reply via email to