My Failed Attempts at Fixing an Obscure Postgres Bug

Note: This is an unfinished bug hunt with no satisfying conclusion. I am documenting what I know so far to hopefully finish solving this later. &#xA; Background &#xA; When building bm25 indexing for LanternDB , I came across a very obscure Postgres bug (which I reported in the pgsql-bugs mailing list ).&#xA;The bug causes a valid PL/pgSQL function call to fail, likely because of some faulty cache…