Looks good. I found no functional problems.
On Mon, Jan 28, 2019 at 10:32:16PM +0100, Peter Eisentraut wrote:
> The fix is to avoid the constant expressions simplification in
> RelationGetIndexAttrBitmap(), so that it becomes safe to call in these
> contexts. The constant expressions simplification comes from the
> calls to RelationGetIndexExpressions()/RelationGetIndexPredicate() via
> BuildIndexInfo(). But RelationGetIndexAttrBitmap() calling
> BuildIndexInfo() is overkill. The latter just takes pg_index catalog
> information, packs it into the IndexInfo structure, which former than
> just unpacks again and throws away.
s/former than/the former then/