In a PL/pgSQL "FOR cursor" statement, the statements executed in the loop

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: 2e8a832dd6e2e75626d59565fbe9029be12771f7
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2010-06-21T09:47:29Z
Releases: 9.0.0
In a PL/pgSQL "FOR cursor" statement, the statements executed in the loop
might close the cursor,  rendering the Portal pointer to it invalid.
Closing the cursor in the middle of the loop is not a very sensible thing
to do, but we must handle it gracefully and throw an error instead of
crashing.

Files

PathChange+/−
src/pl/plpgsql/src/pl_exec.c modified +39 −3