This patch: http://archives.postgresql.org/pgsql-committers/2008-02/msg00356.php which was alleged to prevent memory leaks, seems to have introduced some. The problem is that shutdown_MultiFuncCall() now performs a MemoryContextSwitchTo(flinfo->fn_mcxt); which means that an exiting SRF will now leave CurrentMemoryContext pointing at a long-lived context, not the short-lived context in which the function was called. Subsequent operations that think they are running in a short-lived context (and hence can be cavalier about whether to free allocations) now result in memory leaks.
Did you have a specific reason for adding that? There was no trace of any such switch before, and a quick check with the regression tests shows no harm from taking it out. Plus that makes the memory leak I'm seeing go away ... For the record, the test case that led me to this was select unnest((ts_debug(title)).lexemes) as lex from publications_test; where publications_test.title is a long column of article titles, and I wanted to extract a single column of lexemes. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers