server/plpgsql: Support FOREACH IN ARRAY. - #3402
Conversation
The loop's expression is evaluated once into a record, which unnest then visits in order, assigning each element to the loop variable. An expression that does not yield an array, or that yields a null array, raises as PostgreSQL does. SLICE is not yet supported.
|
|
SummaryThe run covers core database loop behavior across normal array and query processing, ordering, repeated and concurrent calls, error recovery, trigger-driven updates, and boundary conditions. Most exercised flows remain healthy, but nested-loop handling has a functional gap for valid usage with shared loop variables. Merge with caution — the PR introduces a medium-severity failure that breaks valid nested database loops, making affected applications unable to produce results until corrected. A separate medium-severity labeled-exit issue is unrelated to this PR and is a flag for later rather than a merge driver. Tests run by ItoAdditional Findings DetailsThese findings are unrelated to the current changes but were observed during testing. 🟡 Labeled loop exit rejects valid functions
Evidence PackageTip Reply with @itoqa to send us feedback on this test run. |
|
@reltuk DOLT
|

The loop's expression is evaluated once into a record, which unnest then visits in order, assigning each element to the loop variable. An expression that does not yield an array, or that yields a null array, raises as PostgreSQL does. SLICE is not yet supported.