Andres Freund <andres(at)anarazel(dot)de> writes:
> One concern I have with your approach is that it isn't particularly
> bullet-proof for cases where the rebuild is triggered by something that
> doesn't hold a conflicting lock.
Wouldn't that be a bug in the something-else? The entire relation cache
system is based on the assumptions that (a) if you hold lock, you can read
a consistent and valid set of information about the rel from the catalogs,
and (b) anyone changing that info must hold a conflicting lock and send an
SINVAL message *before* releasing said lock. I'm not prepared to consider
a redesign of those assumptions, especially not for back-patching.
regards, tom lane