model-writtenrun 6088 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jiří Fejfar reported that a postgres_fdw merge join between databases with different default collations returned seven rows instead of sixteen, with a reproducer showing incompatible remote ordering #1.
- Tom Lane traced the failure to IMPORT FOREIGN SCHEMA translating remote COLLATE default into the local default and proposed importing a matching named collation, treating remaining default labels as unknown during planning, and documenting the need for explicit collations #2.
- Tom's initial import patch selected a remote named collation matching the database settings, but left questions about missing matches, ambiguous names, future ICU defaults, and locale-dependent regression output #3.
- Tom completed the proposal with explicit C or POSIX collations in tests and planner safety checks; when explicit collations unexpectedly blocked predicate pushdown, he adjusted foreign_expr_walker() to accept matching safely and unsafely derived collations #4.
- Jiří confirmed that Alpine's apparent success came from its locale behavior producing the same ordering, rather than disproving the import diagnosis #5 #6 #7.
- The investigation also exposed unnecessary RelabelType nodes around constants, which Tom identified separately in #4 and fixed without an attached patch in 2072932407 by sharing applyRelabelType() across planner callers.
- After several months, Peter Eisentraut reviewed the proposal and argued that matching names could not guarantee compatible collation versions or attributes; Tom defended it as an incremental improvement while retaining users' responsibility for faithful foreign-table definitions #8 #9.
- Tom refreshed the patch without substantive changes, and Neil Chen subsequently reported successful installation checks, feature testing, and documentation review while asking whether the collation-state condition could be simplified #10 #11.
- After Ibrar Ahmed reported regression failures, Tom updated expected output for new asynchronous tests, but Etsuro Fujita explained that the resulting plans defeated those tests' intended coverage #12 #13 #15.
- Tom supplied another rebase while expressing concern about requiring explicit COLLATE clauses throughout existing foreign-table definitions; Etsuro then resent that patch with an additional test fix restoring remote-update plans through explicit C collations #17 #19.
- Etsuro questioned the semantics of locally sorting a column treated as having unknown collation and favored preserving the existing default-collation assumption, while Tom stressed that this assumption caused the original bug and that reliable cross-server compatibility checks remained elusive #19 #20 #21.
- Etsuro demonstrated that sorting by chr() could still be pushed down incorrectly even with the patch, showing that collation hazards extended beyond foreign columns #22.
- Tom withdrew the behavioral patch because conflating default and unknown collations had too many downsides, proposed a distinct unknown collation for future work, and submitted standalone documentation warnings as the backpatchable short-term response #23.
- Etsuro approved the documentation before Tom committed it unchanged apart from whitespace as 7b0be9fb2d; Tom then confirmed the push and marked the behavioral proposal returned with feedback #24 #26.
- The thread ended with the documentation landed and the behavioral fix withdrawn: a foreign-server option declaring collation compatibility remained a possibility, and Jeremy Schneider raised unresolved questions about differing glibc versions, FDWs, and hot standbys #25 #27 #28.