Thomas Hallgren <thomas(at)tada(dot)se> writes:
> Yes, of course. I see that now. I was unaware that a function had an
> associated "user data". What's the semantics associated with the
> fn_extra? Does it retain its setting throughout a session (i.e. the
> lifetime of the backend process)?
No, just for the query. I'd advise using it only as a cache, although
set-returning functions sometimes use it to hold state associated with
successive rows of their result.
regards, tom lane