Re: Nicely exiting PG_TRY and PG_CATCH

2022-10-20 Thread Mikhail Gribkov
> Yeah, you can't return or goto out of the PG_TRY part. So this is a problem if the check would ever work. (Sorry for such a delayed answer.) Then we need to fix it. Attached is a minimal patch, which changes nothing except for correct PG_TRY exiting. Isn't it better this way? CCing to Peter Ei

Re: Nicely exiting PG_TRY and PG_CATCH

2022-10-07 Thread Tom Lane
Mikhail Gribkov writes: > Usually it's not a good idea to exit PG_TRY() block via return statement. > Otherwise it would leave PG_exception_stack global variable in a wrong > state and next ereport() will jump to some junk address. Yeah, you can't return or goto out of the PG_TRY part. > Another

Nicely exiting PG_TRY and PG_CATCH

2022-10-07 Thread Mikhail Gribkov
Hi hackers, I've found some odd lines in plpython-related code. These look to me like a potential source of problems, but maybe I'm not fully aware of some nuances. Usually it's not a good idea to exit PG_TRY() block via return statement. Otherwise it would leave PG_exception_stack global variabl