Re: JDBC prepared statement: a 32767 limit of arguments number

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Vladislav Malyshkin <mal(at)gromco(dot)com>
Cc: "pgsql-jdbc(at)lists(dot)postgresql(dot)org" <pgsql-jdbc(at)lists(dot)postgresql(dot)org>
Subject: Re: JDBC prepared statement: a 32767 limit of arguments number
Date: 2022-03-09 13:22:57
Message-ID: CAKFQuwa69nCWZmm=wwLMd2Wwr9m36uYDU0BbwfVTOV-0h0+esw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wednesday, March 9, 2022, Vladislav Malyshkin <mal(at)gromco(dot)com> wrote:

> Currently postgres JDBC driver has a 32767 limit for the number of
> prepared statement arguments, see e.g.
> https://luppeng.wordpress.com/2020/05/20/postgresql-jdbc-
> driver-upper-limit-on-parameters-in-preparedstatement/
> Can this limit be lifted. There is no any such a limit in JDBC spec.
>

There is little motivation to try since if you approach that limit you
should probably write your query differently anyway - like using a temp
table and a join instead of an IN operator.

David H.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2022-03-09 15:03:46 Re: JDBC prepared statement: a 32767 limit of arguments number
Previous Message Vladislav Malyshkin 2022-03-09 09:16:29 JDBC prepared statement: a 32767 limit of arguments number