Martin French <Martin(dot)French(at)romaxtech(dot)com> writes:
> So out of curiosity, what would be your approach for data preservation
> cross call?
Usually I'd allocate the space in fcinfo->flinfo->fn_mcxt (which is a
query-lifespan context) and keep a pointer to it in
fcinfo->flinfo->fn_extra (which is a void * field that a C function
can do what it pleases with). There are plenty of examples in the
Postgres source code. If you are looking to cache data longer than
one query then it takes more thought.
regards, tom lane