File tree 1 file changed +14
-0
lines changed
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)
2981
2981
<structfield>multi_call_memory_ctx</> while doing the first-call setup.
2982
2982
</para>
2983
2983
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
+
2984
2998
<para>
2985
2999
A complete pseudo-code example looks like the following:
2986
3000
<programlisting>
You can’t perform that action at this time.
0 commit comments