model-writtenrun 6860 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Chinmay Kanchi reported that a JSONPath query combining nested NOT and AND returned two rows with a sequential scan but only one with GIN, reproducing the problem on PostgreSQL 16 through trunk #1.
- Tom Lane clarified that the reproduction requires disabling sequential scans and traced the missing row to incorrect handling of a negated AND when one operand cannot become a GIN scan condition #2.
- Tom Lane attached a fix that determines the effective AND/OR operation after applying NOT before deciding whether an unsupported operand can be ignored #2.
- The discussion ends with Tom Lane describing the patch as a quick fix and leaving investigation of similar mistakes open; no subsequent testing or review appears in the supplied thread #2.
- The fix from #2 was subsequently incorporated into Tom Lane's combined submission #1157577 in thread #254140, adding expanded comments, regression tests, and a correction for methods applied to scalar literals; that later submission is the exact matching source for d987ad61d3, whose commit message specifies backpatching through PostgreSQL 14.