On tis, 2009-09-15 at 11:32 -0400, Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > But for extra credit, couldn't we code it so that the context is set
> > before the PL handler is called, so that we get this functionality into
> > all PLs at once?
>
> FWIW, I don't particularly agree with that --- there is no reason to
> suppose that all PLs will want to do this exactly the same way.
I'd imagine that we simply set the context to "$language function
$name", probably in fmgr_info_other_lang(). If a language wants more
than that, it can set another level of context. Of course this way we
would not save much code in, say, PL/Perl, but all the other PLs that
are currently not using this stuff at all would get it for free.