postgres-nio icon indicating copy to clipboard operation
postgres-nio copied to clipboard

Increase bind parameters limit

Open MahdiBM opened this issue 3 years ago • 0 comments

The problem

Right now PostgresNIO doesn't allow queries with bind parameters count more than Int16.max (32768). This is despite Postgres 10+ supporting up to (UInt16.max - 1) parameters (65535). For reference for Postgres 14, see https://www.postgresql.org/docs/14/postgres-fdw.html and search the page for "batch_size". I couldn't find documentation on this on lower Postgres versions, but manually tested the PR (see below).

Solution

This PR increases that limit to 65535 which is more appropriate.

Tests

I don't think there is a need for adding a test, but I changed one of the test's to reflect the changes. We'll see if there is anything I missed, when the CI runs the test.

Other than that, I've manually tested this on Postgres Docker images 10, 11, 12, 13, 14 (The currently supported-by-Postgres versions).

MahdiBM avatar Jun 07 '22 07:06 MahdiBM