Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVthB-009Wjh-1N for pgsql-bugs@arkaria.postgresql.org; Wed, 17 Dec 2025 15:44:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVthA-00E660-1O for pgsql-bugs@arkaria.postgresql.org; Wed, 17 Dec 2025 15:44:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVthA-00E65s-0S for pgsql-bugs@lists.postgresql.org; Wed, 17 Dec 2025 15:44:08 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVth9-001Ah1-1x for pgsql-bugs@lists.postgresql.org; Wed, 17 Dec 2025 15:44:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 5BHFi3FJ2629416; Wed, 17 Dec 2025 10:44:03 -0500 From: Tom Lane To: Dave Cramer cc: ZhangChi <798604270@qq.com>, Greg Sabino Mullane , "David G. Johnston" , "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #19350: Short circuit optimization missed when runningsqlscriptes in JDBC In-reply-to: References: <19350-aed90efec73c66cc@postgresql.org> Comments: In-reply-to Dave Cramer message dated "Wed, 17 Dec 2025 07:55:25 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2629414.1765986243.1@sss.pgh.pa.us> Date: Wed, 17 Dec 2025 10:44:03 -0500 Message-ID: <2629415.1765986243@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dave Cramer 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