File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2981,6 +2981,20 @@ SRF_RETURN_DONE(funcctx)
29812981 <structfield>multi_call_memory_ctx</> while doing the first-call setup.
29822982 </para>
29832983
2984+ <warning>
2985+ <para>
2986+ While the actual arguments to the function remain unchanged between
2987+ calls, if you detoast the argument values (which is normally done
2988+ transparently by the
2989+ <function>PG_GETARG_<replaceable>xxx</replaceable></function> macro)
2990+ in the transient context then the detoasted copies will be freed on
2991+ each cycle. Accordingly, if you keep references to such values in
2992+ your <structfield>user_fctx</>, you must either copy them into the
2993+ <structfield>multi_call_memory_ctx</> after detoasting, or ensure
2994+ that you detoast the values only in that context.
2995+ </para>
2996+ </warning>
2997+
29842998 <para>
29852999 A complete pseudo-code example looks like the following:
29863000<programlisting>
You can’t perform that action at this time.
0 commit comments