postgresql/src/include/executor
Tom Lane 06d5eacbc0 Avoid leaking memory while evaluating arguments for a table function.
ExecMakeTableFunctionResult evaluated the arguments for a function-in-FROM
in the query-lifespan memory context.  This is insignificant in simple
cases where the function relation is scanned only once; but if the function
is in a sub-SELECT or is on the inside of a nested loop, any memory
consumed during argument evaluation can add up quickly.  (The potential for
trouble here had been foreseen long ago, per existing comments; but we'd
not previously seen a complaint from the field about it.)  To fix, create
an additional temporary context just for this purpose.

Per an example from MauMau.  Back-patch to all active branches.
2014-06-19 22:13:54 -04:00
..
execdebug.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
execdesc.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
executor.h Avoid leaking memory while evaluating arguments for a table function. 2014-06-19 22:13:54 -04:00
functions.h pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
hashjoin.h Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
instrument.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeAgg.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeAppend.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeBitmapAnd.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeBitmapHeapscan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeBitmapIndexscan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeBitmapOr.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeCtescan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeForeignscan.h Implement an API to let foreign-data wrappers actually be functional. 2011-02-20 00:18:14 -05:00
nodeFunctionscan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeGroup.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeHash.h pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
nodeHashjoin.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeIndexscan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeLimit.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeLockRows.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeMaterial.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeMergeAppend.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeMergejoin.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeModifyTable.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeNestloop.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeRecursiveunion.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeResult.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeSeqscan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeSetOp.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeSort.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeSubplan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeSubqueryscan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeTidscan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeUnique.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeValuesscan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeWindowAgg.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
nodeWorktablescan.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
spi.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
spi_priv.h Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
tstoreReceiver.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
tuptable.h Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00