Andres Freund <andres@anarazel.de> writes:
> I think we basically have to move the setting of PROC_IN_VACUUM to the last
> moment, when we've done everything else, and then force a new snapshot to be
> computed after.
Maybe we can add Assert(!PROC_IN_VACUUM) to catalog accesses?
But the main reason I'm concerned about this is that I fear people
will unthinkingly put catalog accesses into error paths, where
they might well not get exercised by any normal testing.
The poster child for this is something like
if (unlikely-condition)
elog(ERROR, "Houston, we have a problem with table %s",
get_rel_name(relid));
Assertions are unlikely to help us catch that.
regards, tom lane