Peter Eisentraut <[EMAIL PROTECTED]> writes: > Heikki Linnakangas wrote: >> It still feels unsafe to call ExecEvalExpr while holding on to xml >> structs. It means that it's not safe for external modules to use >> libxml2 and call xmlMemSetup or xmlSetGenericErrorFunc themselves.
> Well yeah, they shouldn't do that. I don't think we want to support > that. I'm with Heikki that it would be cleaner/safer if we could allow that. The particular case that's bothering me is the idea that something like Perl could well try to use libxml internally, and if so it'd very likely call these functions. Now if Perl thinks it's got sole control, and tries to (say) re-use the results of xmlInitParser across calls, we're screwed anyway. But that's not an argument for designing our own code in a way that guarantees it can't share libxml with other code. So I'm thinking that we should continue to call xmlMemSetup, xmlSetGenericErrorFunc, and xmlInitParser (if needed) at the start of every XML function, and reorganize the code so that we don't call out to random other code until we've shut down libxml again. The main disadvantage I can see of reorganizing like that is that it will increase xmlelement's transient memory consumption, since it will need to accumulate all the OutputFunctionCall result strings before it starts to pass them to libxml. This probably isn't a huge problem though. Has anyone started actively working on this yet? If not, I can tackle it. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq