On Thu, 1 Aug 2019 at 07:40, Tom Lane <t...@sss.pgh.pa.us> wrote: > Andres Freund <and...@anarazel.de> writes: > > Unfortunately foreach(ListCell *lc, ...) doesn't work with the current > > definition. Which I think isn't great, because the large scopes for loop > > iteration variables imo makes the code harder to reason about. > > Totally agree.
> > you can only put one <declaration> into the first element of a > for (;;). > Use an anonymous block outer scope? Or if not permitted even by C99 (which I think it is), a do {...} while (0); hack? -- Craig Ringer http://www.2ndQuadrant.com/ 2ndQuadrant - PostgreSQL Solutions for the Enterprise