Re: Document parameter count limit

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Document parameter count limit
Date: 2022-11-23 19:35:59
Message-ID: CAKFQuwbJZ_jvrA3oNWGfNvpKwQ66X6rcTWDezZPyvSrCusmddg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 23, 2022 at 11:47 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Does this come up enough to document it? I assume the error message the
> > user receives is clear.
>
> Looks like you get
>
> if (nParams < 0 || nParams > PQ_QUERY_PARAM_MAX_LIMIT)
> {
> libpq_append_conn_error(conn, "number of parameters must be
> between 0 and %d",
> PQ_QUERY_PARAM_MAX_LIMIT);
> return 0;
> }
>
> which seems clear enough.
>
> I think the concern here is that somebody who's not aware that a limit
> exists might write an application that thinks it can send lots of
> parameters, and then have it fall over in production. Now, I've got
> doubts that an entry in the limits.sgml table will do much to prevent
> that scenario. But perhaps offering the advice to use an array parameter
> will be worthwhile even after-the-fact.
>

It comes up enough in places I troll that having a link to drop into a
reply would be nice.
I do believe that people who want to use a large parameter list likely have
that question in the back of their mind, and looking at a page called
"System Limits" is at least plausibly something they would do. Since they
are really caring about parse-bind-execute, and they aren't likely to dig
into libpq, this seems like the best spot (as opposed to, say PREPARE)

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-11-23 19:50:10 Re: drop postmaster symlink
Previous Message samay sharma 2022-11-23 19:30:54 Re: Documentation for building with meson