model-writtenrun 834 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Chao Li reported that fast defaults for constrained domains could raise division-by-zero errors on empty tables and submitted two alternatives: catch errors during domain checking or bypass the fast path for physically empty tables, with the latter missing tables emptied by DELETE #1.
- Heikki Linnakangas considered rejecting an invalid default reasonable, but Chao emphasized compatibility and the usefulness of defaults that force callers to supply a value #2 #3.
- Tom Lane highlighted inconsistent CREATE TABLE and ALTER TABLE behavior and raised a possible dump/restore hazard; Andrew Dunstan then asked which proposed fix should be adopted #4 #5.
- After reviewing the alternatives, Tom rejected catching arbitrary errors without transaction cleanup and favored skipping default evaluation for tables known to be empty, but concluded that a proper Table AM callback made the redesign too late for PostgreSQL 19 and recommended reverting the feature #6.
- Chao paused work pending Andrew's decision and explained that scanning for live rows would add undesirable work merely to decide whether to evaluate the default #7.
- jian he demonstrated similar CREATE-versus-ALTER behavior for ordinary types and argued from pg_dump's implementation that it does not emit ALTER TABLE ADD COLUMN commands, challenging the proposed dump/restore failure scenario #8 #9.
- Andrew agreed to revert because the optimization needed a Table AM callback, while Tom maintained that selectively suppressing domain-check errors was fundamentally inconsistent even after jian's clarification #10 #11.
- Andrew subsequently committed the revert, including removal of the feature's compiler-warning follow-up; neither attached fix landed, and the proposed redesign was deferred to PostgreSQL 20 a0354e29c4 #6.