- pg_get_indexdef(I.oid) AS indexdef + pg_get_indexdef(X.indexrelid) AS indexdef Fixing it this way looks like a good idea to me to bypass those cache lookup errors caused by non-index relations. Now I think that you need as well to update the regression test output.
I observed one regression failure caused by this fix. So fixed the same in new patch.