pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
parameter limit
4+ messages / 3 participants
[nested] [flat]

* parameter limit
@ 2020-04-23 14:33 Scott Ribe <scott_ribe@elevated-dev.com>
  2020-04-23 14:48 ` Re: parameter limit Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Scott Ribe @ 2020-04-23 14:33 UTC (permalink / raw)
  To: pgsql-general

In libpq, PQexecParams has nParams as type int. So on any reasonable platform, that's at least 4 bytes. My question then is: when I see documented limits of 65535 params in various drivers and libraries, that is NOT a restriction of libpq nor of the protocol, but rather an arbitrary limit of the driver/library, correct?

--
Scott Ribe
scott_ribe@elevated-dev.com
https://www.linkedin.com/in/scottribe/








^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: parameter limit
  2020-04-23 14:33 parameter limit Scott Ribe <scott_ribe@elevated-dev.com>
@ 2020-04-23 14:48 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2020-04-23 14:54   ` Re: parameter limit David G. Johnston <david.g.johnston@gmail.com>
  2020-04-23 15:04   ` Re: parameter limit Scott Ribe <scott_ribe@elevated-dev.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Adrian Klaver @ 2020-04-23 14:48 UTC (permalink / raw)
  To: Scott Ribe <scott_ribe@elevated-dev.com>; pgsql-general

On 4/23/20 7:33 AM, Scott Ribe wrote:
> In libpq, PQexecParams has nParams as type int. So on any reasonable platform, that's at least 4 bytes. My question then is: when I see documented limits of 65535 params in various drivers and libraries, that is NOT a restriction of libpq nor of the protocol, but rather an arbitrary limit of the driver/library, correct?

No.

From:

src/interfaces/libpq/fe-exec.c

if (nParams < 0 || nParams > 65535)
         {
                 printfPQExpBuffer(&conn->errorMessage,
                                                   libpq_gettext("number 
of parameters must be between 0 and 65535\n"));
                 return 0;
         }

> 
> --
> Scott Ribe
> scott_ribe@elevated-dev.com
> https://www.linkedin.com/in/scottribe/
> 
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: parameter limit
  2020-04-23 14:33 parameter limit Scott Ribe <scott_ribe@elevated-dev.com>
  2020-04-23 14:48 ` Re: parameter limit Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-04-23 14:54   ` David G. Johnston <david.g.johnston@gmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: David G. Johnston @ 2020-04-23 14:54 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: Scott Ribe <scott_ribe@elevated-dev.com>; pgsql-general

On Thursday, April 23, 2020, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

> On 4/23/20 7:33 AM, Scott Ribe wrote:
>
>> In libpq, PQexecParams has nParams as type int. So on any reasonable
>> platform, that's at least 4 bytes. My question then is: when I see
>> documented limits of 65535 params in various drivers and libraries, that is
>> NOT a restriction of libpq nor of the protocol, but rather an arbitrary
>> limit of the driver/library, correct?
>>
>
> No.
>
> From:
>
> src/interfaces/libpq/fe-exec.c
>
> if (nParams < 0 || nParams > 65535)
>         {
>                 printfPQExpBuffer(&conn->errorMessage,
>                                                   libpq_gettext("number of
> parameters must be between 0 and 65535\n"));
>                 return 0;
>         }
>

Or, from the specification for the Bind Message in the documentation:

https://www.postgresql.org/docs/12/protocol-message-formats.html

 Int16

The number of parameter values that follow

David J.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: parameter limit
  2020-04-23 14:33 parameter limit Scott Ribe <scott_ribe@elevated-dev.com>
  2020-04-23 14:48 ` Re: parameter limit Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-04-23 15:04   ` Scott Ribe <scott_ribe@elevated-dev.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Scott Ribe @ 2020-04-23 15:04 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general

> On Apr 23, 2020, at 8:48 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> 
> No.

Ah, thanks a lot for that info.

It's not that I really normally want to have bazillions of params.

But we have some moderately large inserts, that are showing a sudden non-linear dropoff when scaling up, and a suspicion that the performance dropoff is NOT actually in PG. So, lots of spelunking...




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2020-04-23 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 14:33 parameter limit Scott Ribe <scott_ribe@elevated-dev.com>
2020-04-23 14:48 ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-04-23 14:54   ` David G. Johnston <david.g.johnston@gmail.com>
2020-04-23 15:04   ` Scott Ribe <scott_ribe@elevated-dev.com>

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