Fix things so that array_agg_finalfn does not modify or free its input
Tom Lane <tgl@sss.pgh.pa.us>
Fix things so that array_agg_finalfn does not modify or free its input ArrayBuildState, per trouble report from Merlin Moncure. By adopting this fix, we are essentially deciding that aggregate final-functions should not modify their inputs ever. Adjust documentation and comments to match that conclusion.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/xaggr.sgml | modified | +7 −3 |
| src/backend/executor/nodeWindowAgg.c | modified | +3 −4 |
| src/backend/utils/adt/arrayfuncs.c | modified | +15 −3 |
| src/backend/utils/adt/array_userfuncs.c | modified | +6 −3 |