From fc4974d2de3d8325d823cbea2d65b4ae549b9c8f Mon Sep 17 00:00:00 2001 From: shihao zhong Date: Wed, 11 Nov 2026 23:01:27 -0500 Subject: [PATCH v1] Check the types of the settings passed to the REPACK decoding worker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: Shihao Zhong Suggested-by: Álvaro Herrera Discussion: https://postgr.es/m/avSRIHPxxfgWB6Bw@alvherre.pgsql --- src/backend/commands/repack.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c index 8cf339a9cc7..41959f2ca45 100644 --- a/src/backend/commands/repack.c +++ b/src/backend/commands/repack.c @@ -3885,7 +3885,15 @@ start_repack_decoding_worker(Oid relid) /* * Transmit any relevant settings to the worker too. These would override * any role- or database-level configuration with that from this session. + * The static assertions make sure the fields keep the type of the GUC + * variables, should any of them change. */ + StaticAssertVariableIsOfTypeMacro(LockTimeout, + typeof(shared->lock_timeout)); + StaticAssertVariableIsOfTypeMacro(TransactionTimeout, + typeof(shared->transaction_timeout)); + StaticAssertVariableIsOfTypeMacro(temp_file_limit, + typeof(shared->temp_file_limit)); shared->lock_timeout = LockTimeout; shared->transaction_timeout = TransactionTimeout; shared->temp_file_limit = temp_file_limit; -- 2.37.1 (Apple Git-137.1)