I wrote: > The issue might be argued to be insignificant because the autovacuum > worker is just going to do proc_exit anyway. But if it encountered > another error during proc_exit, elog.c might try to invoke error > callbacks using garbage callback data.
Oh --- looking closer, proc_exit itself will clear error_context_stack before doing much. So a problem would only occur if we suffered an error during EmitErrorReport, which seems somewhat unlikely. Still, it's bad that this code isn't like all the others. There's certainly no downside to clearing the pointer. regards, tom lane