model-writtenrun 5975 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Dian M Fay proposed a use_local_type column option so a remote enum could be represented locally as text without maintaining matching enum definitions; the implementation cast remote column references to the locally declared type #1.
- Ashutosh Bapat questioned the type-compatibility assumptions, Georgios Kokolatos raised correctness concerns and suggested a remote view, and David Steele supported that alternative; Dian explained that maintaining views would still impose unwanted schema coordination #2 #4 #5 #6.
- Tom Lane accepted the usefulness of differing local and remote types but objected that column casts could prevent index use and required the remote server to know the local type; he proposed omitting constant casts and relying on remote operator resolution instead #7.
- Dian replaced the column option with context-based cast suppression for text comparisons, initially limiting it to text after encountering a numeric regression, and returned after several months with a rebase #8 #9.
- Tom identified unsafe propagation of cast suppression into nested expressions and requested direct handling of constant operands on either side; Dian implemented a new deparseConst mode that suppresses casts for string literals while preserving numeric behavior #10 #11.
- Tom supplied a revision requiring equal operand types and a binary operator with exactly one constant, then proposed restricting the other operand to a plain Var to avoid uncertainty about coercions and remote semantics #12 #13.
- Dian restricted suppression to Vars while also allowing RelabelType wrappers for varchar support; Tom pointed out that some such casts change comparison semantics and requested an implicit-cast restriction #14 #15.
- Dian separated the Var-only implementation and implicit-RelabelType support into two patches, and Tom recombined them with an additional check that the Var actually refers to a foreign column rather than a local value #16 #17.
- Dian tested the final attachment and reported that it looked good, and Tom committed that attachment unchanged as f8abb0f5e1 #18 #19.
- The thread ended with the revised feature fully committed and the original column option abandoned; Tom retained implicit-RelabelType support for varchar usefulness but recorded that it might need removal if semantic problems surfaced f8abb0f5e1 #19.