model-writtenrun 4835 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David G. Johnston reported that jsonb_path_exists() incorrectly returned true for an undefined variable because executeItemOptUnwrapTarget() skipped evaluation, and also questioned constant-expression behavior in #1.
- Alexander Korotkov agreed that variables were broken and supplied a patch separating their evaluation from constants in #3; during the ensuing discussion, he defended constant existence checks as analogous to EXISTS over a constant SELECT, while Johnston questioned the documentation and the distinction between existence and matching #4 #5 #6 #7 #8.
- Korotkov corrected an invalid pfree() in #9, but questioned whether the patch's broader suppression of missing-variable errors was appropriate, especially for backpatching.
- Johnston supplied regression tests and results in #10, arguing that existence checks should raise the same missing-variable error as other JSONPath functions; he accepted constant behavior as internally consistent and left documentation clarification for separate work.
- Korotkov adopted that direction in #11, replacing the broader implementation with a small change that forces variable evaluation and incorporating Johnston's tests with the corrected error expectation.
- The jointly authored patch from #11 landed as 3161ae86ce with only comment wrapping changed, and Korotkov confirmed backpatching through PostgreSQL 12 in #12.
- The bug fix was complete at the end of the thread, while Johnston recorded a follow-up task to examine the documentation in #13; no documentation patch was submitted here.