From d70b17636ddf1ea2c71d1c7bc477372b36ccb66b Mon Sep 17 00:00:00 2001 From: Tomas Vondra Date: Sat, 29 Mar 2025 15:14:47 +0100 Subject: amcheck: Move common routines into a separate module Before performing checks on an index, we need to take some safety measures that apply to all index AMs. This includes: * verifying that the index can be checked - Only selected AMs are supported by amcheck (right now only B-Tree). The index has to be valid and not a temporary index from another session. * changing (and then restoring) user's security context * obtaining proper locks on the index (and table, if needed) * discarding GUC changes from the index functions Until now this was implemented in the B-Tree amcheck module, but it's something every AM will have to do. So relocate the code into a new module verify_common for reuse. The shared steps are implemented by amcheck_lock_relation_and_check(), receiving the AM-specific verification as a callback. Custom parameters may be supplied using a pointer. Author: Andrey Borodin Reviewed-By: José Villanova Reviewed-By: Aleksander Alekseev Reviewed-By: Nikolay Samokhvalov Reviewed-By: Andres Freund Reviewed-By: Tomas Vondra Reviewed-By: Mark Dilger Reviewed-By: Peter Geoghegan Reviewed-By: Kirill Reshke Discussion: https://postgr.es/m/45AC9B0A-2B45-40EE-B08F-BDCF5739D1E1%40yandex-team.ru --- src/tools/pgindent/typedefs.list | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index 1279b69422a..b66affbea56 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -194,6 +194,7 @@ BOOLEAN BOX BTArrayKeyInfo BTBuildState +BTCallbackState BTCycleId BTDedupInterval BTDedupState -- cgit v1.2.3