Move return statements out of PG_TRY blocks.
Nathan Bossart <nathan@postgresql.org>
Move return statements out of PG_TRY blocks. If we exit a PG_TRY block early via "continue", "break", "goto", or "return", we'll skip unwinding its exception stack. This change moves a couple of such "return" statements in PL/Python out of PG_TRY blocks. This was introduced in d0aa965c0a and affects all supported versions. We might also be able to add compile-time checks to prevent recurrence, but that is left as a future exercise. Reported-by: Mikhail Gribkov, Xing Guo Author: Xing Guo Reviewed-by: Michael Paquier, Andres Freund, Tom Lane Discussion: https://postgr.es/m/CAMEv5_v5Y%2B-D%3DCO1%2Bqoe16sAmgC4sbbQjz%2BUtcHmB6zcgS%2B5Ew%40mail.gmail.com Discussion: https://postgr.es/m/CACpMh%2BCMsGMRKFzFMm3bYTzQmMU5nfEEoEDU2apJcc4hid36AQ%40mail.gmail.com Backpatch-through: 11 (all supported versions)
Files
| Path | Change | +/− |
|---|---|---|
| src/pl/plpython/plpy_exec.c | modified | +36 −18 |
Discussion
- Nicely exiting PG_TRY and PG_CATCH 3 messages · 2022-10-07 → 2022-10-20
- PL/Python: Fix return in the middle of PG_TRY() block. 20 messages · 2023-01-12 → 2023-05-05