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.94.2) (envelope-from ) id 1qY82P-000rKe-C8 for pgsql-general@arkaria.postgresql.org; Mon, 21 Aug 2023 16:45:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qY82N-008Xtr-Oa for pgsql-general@arkaria.postgresql.org; Mon, 21 Aug 2023 16:45:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qY82N-008Xtf-CJ for pgsql-general@lists.postgresql.org; Mon, 21 Aug 2023 16:45:55 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qY82K-000CiS-8u for pgsql-general@lists.postgresql.org; Mon, 21 Aug 2023 16:45:54 +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 37LGjmsh2865014; Mon, 21 Aug 2023 12:45:48 -0400 From: Tom Lane To: "David G. Johnston" cc: Edoardo Panfili , pgsql-general@lists.postgresql.org Subject: Re: The same prepared query yield "-1" the first six times and then "-1.0" In-reply-to: References: <5C40B9CC-40E4-4AC5-95A1-E5A521C282EF@gmail.com> Comments: In-reply-to "David G. Johnston" message dated "Mon, 21 Aug 2023 08:50:21 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2865012.1692636348.1@sss.pgh.pa.us> Date: Mon, 21 Aug 2023 12:45:48 -0400 Message-ID: <2865013.1692636348@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > Otherwise, I agree this seems like a bug, probably in the JDBC driver, > though one pertains to style as opposed to semantics since both answers are > technically correct. I don't see any such behavior change in psql, so I agree that this is probably something to ask about on the JDBC list. My first thought was that the output change occurs when the query transitions from custom to generic plan. However, since there are no parameters involved the backend would go for a generic plan immediately. Having said that, I seem to recall that the JDBC driver has its own notion of custom vs generic execution, so maybe the issue is around there somewhere. regards, tom lane