Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgVVu-0003Rg-Ea for pgsql-bugs@arkaria.postgresql.org; Sun, 26 Mar 2023 18:54:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pgVVs-00059x-A4 for pgsql-bugs@arkaria.postgresql.org; Sun, 26 Mar 2023 18:54:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgVVs-00059m-1W for pgsql-bugs@lists.postgresql.org; Sun, 26 Mar 2023 18:54:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgVVp-000611-CC for pgsql-bugs@lists.postgresql.org; Sun, 26 Mar 2023 18:54:42 +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 32QIsd1W3016277; Sun, 26 Mar 2023 14:54:39 -0400 From: Tom Lane To: Matthew Bellew cc: pgsql-bugs@lists.postgresql.org Subject: Re: Parameter marker swapping in {fn timestampdiff()} In-reply-to: References: Comments: In-reply-to Matthew Bellew message dated "Sun, 26 Mar 2023 11:14:44 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3016275.1679856879.1@sss.pgh.pa.us> Date: Sun, 26 Mar 2023 14:54:39 -0400 Message-ID: <3016276.1679856879@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Matthew Bellew writes: > I recently made a small change to a core utility and our sql tests flagged > some unexpected results. I traced these to timestampdiff(). Below is a > running code function (except for creating the JDBC Connection). I expect > the same result for all three executeQuery() calls. The version that uses > string literals return 366 and the versions that use parameter markers > return -366. You probably want to report that on the pgsql-jdbc list. This list mainly deals in bugs in core Postgres, so I'm not very sure whether the JDBC maintainers read it. regards, tom lane