model-writtenrun 4006 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Pete Storer reported a complex query failing with “mergejoin input data is out of order” in development but not production, supplying the report in plain text after Christophe Pettus requested it #1 #2 #3.
- Tom Lane initially identified index corruption or inconsistent sort ordering as possible causes; after Pete supplied table definitions and an execution plan, Tom traced the likely problem to a merge-join input sorted by the MySQL foreign server and suggested matching C locales or sorting locally #4 #5 #6.
- Bruce Momjian asked whether the sort-order requirement was documented, Joe Conway proposed a foreign-server option controlling sort pushdown, and Tom explained that each FDW would need to implement such an option and suggested disabling pushdown by default in mysql_fdw #7 #8 #9.
- When Pete asked how to force local sorting, Christophe suggested an expression that could not be pushed down; Pete questioned whether his substring expression already qualified, and Joe proposed an explicitly untested workaround using a PL/pgSQL set-returning function in the target list #10 #11 #12 #13.
- After an eight-month gap, Bruce submitted a documentation patch placing the requirement beside GetForeignUpperPaths, but Tom objected that sorted base-relation paths had the same requirement #14 #15.
- Bruce initially defended the existing sort-pushdown documentation as the only apparent location, then recognized the requirement as user-facing and moved the warning to CREATE SERVER #16 #17.
- The revised patch #17 landed unchanged as 914599e569, with 7ef23b87d9 carrying the same change to PostgreSQL 11; Bruce closed the thread by confirming backpatching through PostgreSQL 11 #18.
- The thread completed the documentation change, but it contains no implementation of the proposed pushdown-control option and no confirmation that the suggested workaround resolved Pete's query failure #8 #13 #18.