The comment of search_indexed_tlist_for_var says: * In debugging builds, we cross-check the varnullingrels of the subplan * output Var based on nrm_match.
However, this cross-check will also be performed in non-debug builds ever since commit 867be9c07, which converts this check from Asserts to test-and-elog. The commit message there also says: Committed separately with the idea that eventually we'll revert this. It might be awhile though. I wonder if now is the time to revert it, since there have been no related bugs reported for quite a while. Otherwise I think we may need to revise the comment of search_indexed_tlist_for_var to clarify that the cross-check is not limited to debugging builds. Please note that if we intend to revert commit 867be9c07, we need to revert 69c430626 too. Thanks Richard