Re: PL/Python: Fix return in the middle of PG_TRY() block.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PL/Python: Fix return in the middle of PG_TRY() block.
Дата
Msg-id 1864041.1673882943@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PL/Python: Fix return in the middle of PG_TRY() block.  (Xing Guo <higuoxing@gmail.com>)
Ответы Re: PL/Python: Fix return in the middle of PG_TRY() block.  (Xing Guo <higuoxing@gmail.com>)
Re: PL/Python: Fix return in the middle of PG_TRY() block.  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: pgsql: Add new GUC createrole_self_grant.
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: pgsql: Add new GUC createrole_self_grant.