Re: BUG #19350: Short circuit optimization missed when running sql scriptes in JDBC

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: ZhangChi <798604270@qq.com>
Cc: "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2025-12-10T13:46:51Z
Lists: pgsql-bugs
On Wednesday, December 10, 2025, ZhangChi <798604270@qq.com> wrote:

> Hi David J.
>
> Thanks for your reply. I wonder why this query triggers an error under
> JDBC but not in the CLI.
>

Because the planner can simplify the expression if it sees a constant null
value but cannot when everything is injected via parameter.

David J.