Adjust nodeFunctionscan.c to reset transient memory context between calls
Tom Lane <tgl@sss.pgh.pa.us>
Adjust nodeFunctionscan.c to reset transient memory context between calls to the table function, thus preventing memory leakage accumulation across calls. This means that SRFs need to be careful to distinguish permanent and local storage; adjust code and documentation accordingly. Patch by Joe Conway, very minor tweaks by Tom Lane.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pgstattuple/pgstattuple.c | modified | +23 −55 |
| contrib/pgstattuple/pgstattuple.sql.in | modified | +13 −13 |
| contrib/pgstattuple/README.pgstattuple | modified | +5 −5 |
| contrib/tablefunc/tablefunc.c | modified | +21 −7 |
| doc/src/sgml/xfunc.sgml | modified | +35 −11 |
| src/backend/executor/nodeFunctionscan.c | modified | +7 −1 |
| src/backend/utils/adt/lockfuncs.c | modified | +22 −19 |
| src/backend/utils/fmgr/funcapi.c | modified | +7 −14 |
| src/backend/utils/misc/guc.c | modified | +7 −1 |
| src/include/funcapi.h | modified | +14 −8 |