Re: BUG #19350: Short circuit optimization missed when runningsqlscriptes in JDBC
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dave Cramer <davecramer@postgres.rocks>
Cc: ZhangChi <798604270@qq.com>, Greg Sabino Mullane <htamfids@gmail.com>,
"David G. Johnston" <david.g.johnston@gmail.com>,
"pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2025-12-17T15:44:03Z
Lists: pgsql-bugs
Dave Cramer <davecramer@postgres.rocks> writes: > On Tue, 16 Dec 2025 at 20:40, ZhangChi <798604270@qq.com> wrote: >> But my question is that in the CLI, the test case (like foo2) I showed can >> return the results. But when I run the same test case in JDBC, the test >> case triggers an error. I wonder why there is an inconsistency. > Possibly because JDBC does everything using the V3 protocol whereas psql > does not. psql uses simple query. The error will occur if we try to build a "custom plan" for the prepared query. I suspect a discrepancy in the plan_cache_mode settings between JDBC and the user's psql setup. regards, tom lane