postgres.git / summary / log / commit / refs
commit df709d706ce9f9913cad3ff01f64a0a4c67eb07d
Author: David Rowley <drowley@postgresql.org>
Date: Fri Sep 18 03:50:21 2026 +0000
First released in: 14.25, 15.20, 16.16, 17.12, 18.7, 19.0
Add CHECK_FOR_INTERRUPTS when building pruning steps
Building the partition pruning steps for excessively complex queries
can take some time. Add CHECK_FOR_INTERRUPTS() to
get_steps_using_prefix_recurse() to allow more timely processing of
interruptions.
Bug: #19692
Reported-by: Qifan Liu <imchifan@163.com>
Discussion: https://postgr.es/m/19692-dacfc57cda5035fc@postgresql.org
Backpatch-through: 14
src/backend/partitioning/partprune.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/backend/partitioning/partprune.c b/src/backend/partitioning/partprune.c
index 86fa13b3e05..25761f3814d 100644
--- a/src/backend/partitioning/partprune.c
+++ b/src/backend/partitioning/partprune.c
@@ -2554,6 +2554,8 @@ get_steps_using_prefix_recurse(GeneratePruningStepsContext *context,
/* Actually, recursion would be limited by PARTITION_MAX_KEYS. */
check_stack_depth();
+ CHECK_FOR_INTERRUPTS();
+
Assert(start != NULL);
cur_keyno = ((PartClauseInfo *) lfirst(start))->keyno;
final_keyno = ((PartClauseInfo *) llast(prefix))->keyno;
[parent: 6b0760a10a32]