On 04/04/2018 07:54 PM, Tom Lane wrote: > Tomas Vondra <tomas.von...@2ndquadrant.com> writes: >> This should do the trick - I've failed to realize exec_stmt_call may >> exit by calling elog(ERROR) too, in which case the plan pointer was not >> reset. > >> This does fix the failures presented here, but I don't think it's the >> right solution > > No, it's completely unacceptable. >
Yes, I realize that and I was not really suggesting this as a proper fix. It was meant more to demonstrate that it's still the same issue with the same dangling pointer. > If there's really no other way, you could use a PG_TRY block to > ensure that the pointer gets reset on the way out. But I question > why we've got a design that requires that in the first place. It's > likely to have more problems than this. > I agree it needs a solution that does not require us to track and manually reset pointers on random places. No argument here. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services