Re: BUG #19350: Short circuit optimization missed when runningsqlscriptes in JDBC

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Cramer <davecramer(at)postgres(dot)rocks>
Cc: ZhangChi <798604270(at)qq(dot)com>, Greg Sabino Mullane <htamfids(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19350: Short circuit optimization missed when runningsqlscriptes in JDBC
Date: 2025-12-17 15:44:03
Message-ID: 2629415.1765986243@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dave Cramer <davecramer(at)postgres(dot)rocks> writes:
> On Tue, 16 Dec 2025 at 20:40, ZhangChi <798604270(at)qq(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message ZhangChi 2025-12-17 15:52:23 Re: BUG #19357: PostgreSQL generates a custom plan that performs worse than the generic plan for a certain query.
Previous Message Dave Cramer 2025-12-17 15:39:21 Re: BUG #19350: Short circuit optimization missed when runningsqlscriptes in JDBC