Amit Kapila <amit.kapil...@gmail.com> writes: > On Thu, Apr 15, 2021 at 4:00 PM Japin Li <japi...@hotmail.com> wrote: >> >> The RelationIdGetRelation() comment says: >> > Caller should eventually decrement count. (Usually, > that happens by calling RelationClose().) >> >> However, it doesn't do it in ReorderBufferProcessTXN(). >> I think we should close it, here is a patch that fixes it. Thoughts? >>
> +1. Your fix looks correct to me but can we test it in some way? I think this code has a bigger problem: it should not be using RelationIdGetRelation and RelationClose directly. 99.44% of the backend goes through relation_open or one of the other relation.c wrappers, so why doesn't this? Possibly the answer is "it copied the equally misguided code in pgoutput.c". A quick grep shows nothing else doing it this way. regards, tom lane