pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Scott Ribe <scott_ribe@elevated-dev.com>
To: pgsql-general@postgresql.org
Subject: Re: parameter limit
Date: Thu, 23 Apr 2020 07:48:27 -0700
Message-ID: <6e6ac332-087c-7a65-3340-e4c50b916f54@aklaver.com> (raw)
In-Reply-To: <0A6380C4-E0E0-4554-B98C-0889CF03C4C1@elevated-dev.com>
References: <0A6380C4-E0E0-4554-B98C-0889CF03C4C1@elevated-dev.com>

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





view thread (4+ messages)  latest in thread

Message-ID: <6e6ac332-087c-7a65-3340-e4c50b916f54@aklaver.com>
Permalink:  ../6e6ac332-087c-7a65-3340-e4c50b916f54@aklaver.com/
Also on:    postgresql.org/message-id/6e6ac332-087c-7a65-3340-e4c50b916f54@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, scott_ribe@elevated-dev.com
  Subject: Re: parameter limit
  In-Reply-To: <6e6ac332-087c-7a65-3340-e4c50b916f54@aklaver.com>
  References: <0A6380C4-E0E0-4554-B98C-0889CF03C4C1@elevated-dev.com> <6e6ac332-087c-7a65-3340-e4c50b916f54@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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