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 1tYVVD-00BThC-Is for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Jan 2025 19:26:03 +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 1tYVVB-000Y9t-R1 for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Jan 2025 19:26:02 +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.94.2) (envelope-from ) id 1tYVVB-000Y9k-In for pgsql-bugs@lists.postgresql.org; Thu, 16 Jan 2025 19:26:02 +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 1tYVVA-000l4D-2Z for pgsql-bugs@lists.postgresql.org; Thu, 16 Jan 2025 19:26:01 +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 50GJPwQ61850522; Thu, 16 Jan 2025 14:25:58 -0500 From: Tom Lane To: spsamaan@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18777: Error running unnest function in a two phase commit transaction In-reply-to: <18777-3fa8180f86edfb55@postgresql.org> References: <18777-3fa8180f86edfb55@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 16 Jan 2025 18:35:54 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1850520.1737055558.1@sss.pgh.pa.us> Date: Thu, 16 Jan 2025 14:25:58 -0500 Message-ID: <1850521.1737055558@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > I have a query " SELECT * FROM UNNEST(ARRAY[123456]) " running in a Groovy 4 > code. That code is running in a weblogic 14 server. The driver I'm using is > postgresql-42.7.3.jar. > When the weblogic datasource is configured as a Two-phase commit I got an > error: > Caused by: org.postgresql.util.PSQLException: ERROR: function > unnest(unknown) is not unique Presumably what is happening is that the query actually being sent to the server is something like SELECT * FROM UNNEST($1) with no hint as to what the data type of $1 is, making it impossible to infer the unnest's result type. I don't know whether the JDBC driver or weblogic is more at fault, but this isn't a server-side bug. Some level on the client side has to take responsibility for specifying the data type of the parameter. regards, tom lane