pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #18777: Error running unnest function in a two phase commit transaction
2+ messages / 2 participants
[nested] [flat]
* BUG #18777: Error running unnest function in a two phase commit transaction
@ 2025-01-16 18:35 PG Bug reporting form <noreply@postgresql.org>
2025-01-16 19:25 ` Re: BUG #18777: Error running unnest function in a two phase commit transaction Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2025-01-16 18:35 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: spsamaan@gmail.com
The following bug has been logged on the website:
Bug reference: 18777
Logged by: Sérgio Paulo Samaan Filho
Email address: spsamaan@gmail.com
PostgreSQL version: 15.10
Operating system: linux
Description:
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
Hint: Could not choose a best candidate function. You might need to add
explicit type casts.
Position: 250
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2725)
~[postgresql-42.7.3.jar:42.7.3]
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2412)
~[postgresql-42.7.3.jar:42.7.3]
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:371)
~[postgresql-42.7.3.jar:42.7.3]
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:329)
~[postgresql-42.7.3.jar:42.7.3]
at
org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData(PgPreparedStatement.java:1755)
~[postgresql-42.7.3.jar:42.7.3]
at
weblogic.jdbc.wrapper.PreparedStatement.getParameterMetaData(PreparedStatement.java:1045)
~[com.bea.core.datasource6.jar:14.1.1.0]
at groovy.sql.Sql.getParameterMetaDataSafe(Sql.java:4234)
~[groovy-sql-4.0.6.jar:4.0.6]
at groovy.sql.Sql.setParameters(Sql.java:4216)
~[groovy-sql-4.0.6.jar:4.0.6]
at groovy.sql.Sql.getPreparedStatement(Sql.java:4519)
~[groovy-sql-4.0.6.jar:4.0.6]
at groovy.sql.Sql.getPreparedStatement(Sql.java:4607)
~[groovy-sql-4.0.6.jar:4.0.6]
at groovy.sql.Sql.access$1000(Sql.java:234)
~[groovy-sql-4.0.6.jar:4.0.6]
at groovy.sql.Sql$PreparedQueryCommand.runQuery(Sql.java:4803)
~[groovy-sql-4.0.6.jar:4.0.6]
... 158 more
Disabling Two-phase commit in weblogic (just for testing purpose) thw query
works properly.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #18777: Error running unnest function in a two phase commit transaction
2025-01-16 18:35 BUG #18777: Error running unnest function in a two phase commit transaction PG Bug reporting form <noreply@postgresql.org>
@ 2025-01-16 19:25 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2025-01-16 19:25 UTC (permalink / raw)
To: spsamaan@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-01-16 19:25 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-01-16 18:35 BUG #18777: Error running unnest function in a two phase commit transaction PG Bug reporting form <noreply@postgresql.org>
2025-01-16 19:25 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox