Improve UPDATE/DELETE WHERE CURRENT OF so that they can be used from plpgsql
Tom Lane <tgl@sss.pgh.pa.us>
Improve UPDATE/DELETE WHERE CURRENT OF so that they can be used from plpgsql with a plpgsql-defined cursor. The underlying mechanism for this is that the main SQL engine will now take "WHERE CURRENT OF $n" where $n is a refcursor parameter. Not sure if we should document that fact or consider it an implementation detail. Per discussion with Pavel Stehule.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/plpgsql.sgml | modified | +26 −1 |
| src/backend/executor/execCurrent.c | modified | +63 −11 |
| src/backend/executor/execQual.c | modified | +18 −9 |
| src/backend/executor/nodeTidscan.c | modified | +2 −2 |
| src/backend/nodes/copyfuncs.c | modified | +2 −1 |
| src/backend/nodes/equalfuncs.c | modified | +2 −1 |
| src/backend/nodes/outfuncs.c | modified | +2 −1 |
| src/backend/nodes/readfuncs.c | modified | +2 −1 |
| src/backend/parser/gram.y | modified | +11 −1 |
| src/backend/parser/parse_expr.c | modified | +76 −38 |
| src/backend/utils/adt/ruleutils.c | modified | +11 −3 |
| src/include/executor/executor.h | modified | +4 −2 |
| src/include/nodes/primnodes.h | modified | +7 −2 |