model-writtenrun 7477 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Pavel Stehule reported that EXPLAIN ANALYZE VERBOSE displayed corrupted Remote SQL for postgres_fdw inserts with batch_size 1000 in #1.
- Pavel supplied a reproducer comparing ordinary and batched foreign-table inserts in #2.
- Zhijie Hou traced the corruption to freeing the query string still referenced by fdw_private and attached a fix that copies the execution query in #3, asking whether EXPLAIN should display the original or last rebuilt query.
- Tomas Vondra chose to preserve the original query for EXPLAIN and committed c6a01d9249 with the additional copy proposed in #3, while retaining the existing separate copy of orig_query; his explanation and commit announcement appear in #4.
- The thread ended with Pavel’s thanks in #5 and Takayuki Tsunakawa’s acknowledgment in #6, with the fix committed and no further changes requested.