"Matt Magoffin" <postgresql(dot)org(at)msqr(dot)us> writes:
>> Is this particular query using xml features, and if so which? Actually,
>> could you just show us the whole query and the schemas of the tables
>> it's using?
> No, other than returning a column of type xml.
Huh, I was overthinking the problem. xml_out has a memory leak :-(
More than one in fact: a large leak (equal to size of output) in
the executor context (hence query lifespan) and a small one in
LibxmlContext (hence transaction lifespan).
Try the patch here:
http://archives.postgresql.org/pgsql-committers/2008-09/msg00159.php
(In the long run it might be better if we didn't run datatype output
functions in a query-lifespan context ...)
regards, tom lane