Xing Guo <higuoxing@gmail.com> writes:
> Are there any unsafe codes in pltcl.c? The return statement is in the
> PG_CATCH() block, I think the exception stack has been recovered in
> PG_CATCH block so the return statement in PG_CATCH block should be ok?
Yes, the stack has already been unwound at the start of a PG_CATCH
(or PG_FINALLY) block, so there is no reason to avoid returning
out of those.
In principle you could also mess things up with a "continue", "break",
or "goto" leading out of PG_TRY. That's probably far less likely
than "return", but I wonder whether Andres' compiler hack will
catch that.
regards, tom lane