postgresql/src/test/modules/test_extensions
Peter Eisentraut 81eaaa2c41 Make "directory" setting work with extension_control_path
The extension_control_path setting (commit 4f7f7b0375) did not
support extensions that set a custom "directory" setting in their
control file.  Very few extensions use that and during the discussion
on the previous commit it was suggested to maybe remove that
functionality.  But a fix was easier than initially thought, so this
just adds that support.  The fix is to use the control->control_dir as
a share dir to return the path of the extension script files.

To make this work more sensibly overall, the directory suffix
"extension" is no longer to be included in the extension_control_path
value.  To quote the patch, it would be

-extension_control_path = '/usr/local/share/postgresql/extension:/home/my_project/share/extension:$system'
+extension_control_path = '/usr/local/share/postgresql:/home/my_project/share:$system'

During the initial patch, there was some discussion on which of these
two approaches would be better, and the committed patch was a 50/50
decision.  But the support for the "directory" setting pushed it the
other way, and also it seems like many people didn't like the previous
behavior much.

Author: Matheus Alcantara <mths.dev@pm.me>
Reviewed-by: Christoph Berg <myon@debian.org>
Reviewed-by: David E. Wheeler <david@justatheory.com>
Discussion: https://www.postgresql.org/message-id/flat/aAi1VACxhjMhjFnb%40msg.df7cb.de#0cdf7b7d727cc593b029650daa3c4fbc
2025-05-02 16:35:48 +02:00
..
expected Change SQL-language functions to use the plan cache. 2025-04-02 14:06:02 -04:00
sql Improve reporting of errors in extension script files. 2024-10-22 11:31:45 -04:00
t Make "directory" setting work with extension_control_path 2025-05-02 16:35:48 +02:00
.gitignore Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
Makefile extension_control_path 2025-03-19 07:03:20 +01:00
meson.build extension_control_path 2025-03-19 07:03:20 +01:00
test_ext1--1.0.sql Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext1.control Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext2--1.0.sql Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext2.control Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext3--1.0.sql Ensure commands in extension scripts see the results of preceding DDL. 2017-05-02 18:06:09 -04:00
test_ext3.control Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext4--1.0.sql Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext4.control Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext5--1.0.sql Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext5.control Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext6--1.0.sql In recordExtensionInitPriv(), keep the scan til we're done with it 2016-04-15 21:57:15 -04:00
test_ext6.control In recordExtensionInitPriv(), keep the scan til we're done with it 2016-04-15 21:57:15 -04:00
test_ext7--1.0--2.0.sql Fix test about ignoring extension dependencies during extension scripts. 2016-11-26 13:31:35 -05:00
test_ext7--1.0.sql Fix test about ignoring extension dependencies during extension scripts. 2016-11-26 13:31:35 -05:00
test_ext7--2.0--2.1bad.sql Improve reporting of errors in extension script files. 2024-10-22 11:31:45 -04:00
test_ext7--2.0--2.2bad.sql Improve reporting of errors in extension script files. 2024-10-22 11:31:45 -04:00
test_ext7.control Fix test about ignoring extension dependencies during extension scripts. 2016-11-26 13:31:35 -05:00
test_ext8--1.0.sql Delete deleteWhatDependsOn() in favor of more performDeletion() flag bits. 2016-12-02 14:57:55 -05:00
test_ext8.control Delete deleteWhatDependsOn() in favor of more performDeletion() flag bits. 2016-12-02 14:57:55 -05:00
test_ext9--1.0.sql Explicitly list dependent types as extension members in pg_depend. 2024-03-04 14:49:36 -05:00
test_ext9.control Explicitly list dependent types as extension members in pg_depend. 2024-03-04 14:49:36 -05:00
test_ext_cine--1.0--1.1.sql In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
test_ext_cine--1.0.sql In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
test_ext_cine.control In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
test_ext_cor--1.0.sql In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
test_ext_cor.control In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
test_ext_cyclic1--1.0.sql Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext_cyclic1.control Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext_cyclic2--1.0.sql Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext_cyclic2.control Add CASCADE support for CREATE EXTENSION. 2015-10-03 18:23:40 +02:00
test_ext_evttrig--1.0--2.0.sql Fix use-after-free bug with event triggers in an extension script 2020-09-15 21:03:14 -03:00
test_ext_evttrig--1.0.sql Fix use-after-free bug with event triggers in an extension script 2020-09-15 21:03:14 -03:00
test_ext_evttrig.control Fix use-after-free bug with event triggers in an extension script 2020-09-15 21:03:14 -03:00
test_ext_extschema--1.0.sql Reject substituting extension schemas or owners matching ["$'\]. 2023-08-07 06:05:56 -07:00
test_ext_extschema.control Reject substituting extension schemas or owners matching ["$'\]. 2023-08-07 06:05:56 -07:00
test_ext_req_schema1--1.0.sql Add @extschema:name@ and no_relocate options to extensions. 2023-03-20 18:37:11 -04:00
test_ext_req_schema1.control Add @extschema:name@ and no_relocate options to extensions. 2023-03-20 18:37:11 -04:00
test_ext_req_schema2--1.0.sql Add @extschema:name@ and no_relocate options to extensions. 2023-03-20 18:37:11 -04:00
test_ext_req_schema2.control Add @extschema:name@ and no_relocate options to extensions. 2023-03-20 18:37:11 -04:00
test_ext_req_schema3--1.0.sql Add @extschema:name@ and no_relocate options to extensions. 2023-03-20 18:37:11 -04:00
test_ext_req_schema3.control Add @extschema:name@ and no_relocate options to extensions. 2023-03-20 18:37:11 -04:00
test_ext_set_schema--1.0.sql Repair ALTER EXTENSION ... SET SCHEMA. 2024-05-09 12:19:52 -04:00
test_ext_set_schema.control Repair ALTER EXTENSION ... SET SCHEMA. 2024-05-09 12:19:52 -04:00