Implement RETURN QUERY for PL/PgSQL. This provides some convenient syntax
Neil Conway <neilc@samurai.com>
Implement RETURN QUERY for PL/PgSQL. This provides some convenient syntax sugar for PL/PgSQL set-returning functions that want to return the result of evaluating a query; it should also be more efficient than repeated RETURN NEXT statements. Based on an earlier patch from Pavel Stehule.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/plpgsql.sgml | modified | +48 −29 |
| src/pl/plpgsql/src/gram.y | modified | +26 −2 |
| src/pl/plpgsql/src/pl_exec.c | modified | +60 −1 |
| src/pl/plpgsql/src/pl_funcs.c | modified | +16 −1 |
| src/pl/plpgsql/src/plpgsql.h | modified | +9 −1 |
| src/pl/plpgsql/src/scan.l | modified | +4 −3 |
| src/test/regress/expected/plpgsql.out | modified | +49 −0 |
| src/test/regress/sql/plpgsql.sql | modified | +24 −0 |