Query parameters limit in postgres jdbc driver? - Mailing list pgsql-jdbc

From olafos
Subject Query parameters limit in postgres jdbc driver?
Date
Msg-id 16832734.post@talk.nabble.com
Whole thread Raw
Responses Re: Query parameters limit in postgres jdbc driver?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-jdbc
Hi,

I'm using Toplink JPA with Postgresql JDBC driver in my application and I
encountered the following problem. I'm creating a query with IN clause
containing a couple of thousand of parameters. When the query is sent to the
jdbc driver the following error occurs:

Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build 09d
(12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: An I/O error occured
while sending to the backend.
Error Code: 0
    ...
Caused by: org.postgresql.util.PSQLException: An I/O error occured while
sending to the backend.
    at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:217)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:255)
    at
oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:726)
    at
oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:501)
    ... 40 more
Caused by: java.io.IOException: Tried to send an out-of-range integer as a
2-byte value: 40000
    at org.postgresql.core.PGStream.SendInteger2(PGStream.java:194)
    at
org.postgresql.core.v3.QueryExecutorImpl.sendParse(QueryExecutorImpl.java:769)
    at
org.postgresql.core.v3.QueryExecutorImpl.sendOneQuery(QueryExecutorImpl.java:1036)
    at
org.postgresql.core.v3.QueryExecutorImpl.sendQuery(QueryExecutorImpl.java:643)
    at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:189)
    ... 45 more

Seems like the driver is trying to send the number 40,000 (which is actually
the number of query parameters) as a 2-byte integer. Is there any limit to
the number of jdbc query parameters in postgresql?

Thanks,
Olaf Tomcak



--
View this message in context:
http://www.nabble.com/Query-parameters-limit-in-postgres-jdbc-driver--tp16832734p16832734.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


pgsql-jdbc by date:

Previous
From: ab.spamnews@freenet.de
Date:
Subject: Updated 8.2 translation (German)
Next
From: Chris
Date:
Subject: Creating a sequence