1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

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
This commit is contained in:
David Rowley
2026-09-18 15:52:36 +12:00
parent aad2baff0e
commit 30ed631b20

View File

@@ -2502,6 +2502,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;