Arseny Sher <a.s...@postgrespro.ru> writes: > Valgrind on our internal buildfarm complained about use-after-free > during currentEventTriggerState->commandList manipulations, e.g. lappend > in EventTriggerCollectSimpleCommand. I've discovered that the source of > problem is EventTriggerAlterTableEnd not bothering to switch into its > own context before appending to the list. ced138e8cba fixed this in > master and 13 but wasn't backpatched further, so I see the problem in > 12-.
Yeah, that clearly should have been back-patched --- the fact that it accidentally didn't fail in the most common case wasn't a good reason for leaving the bug in place. I'm not excited about the test case ced138e8cba added though, so I think your proposed patch is fine. Will push shortly. regards, tom lane