pgsql-general
❮
libq API question
- Jump to comment-1Igor Korot<ikorot01@gmail.com>Mar 12, 2026, 10:35 PM UTCHi, ALL,
In the docs I see the following:
[quote]
PGresult PQexecParams(PGconn conn,
[/quote]const char *command, int nParams, const Oid *paramTypes, const char * const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat);
Is there a reason why the parameters are int and not unsigned int?
There is no way the length can be negative...
Is it for backward compatibility?
Thank you.- Jump to comment-1David G. Johnston<david.g.johnston@gmail.com>Mar 12, 2026, 10:39 PM UTCOn Thursday, March 12, 2026, Igor Korot <ikorot01@gmail.com> wrote:
Hi, ALL,
Unsigned ints are, I believe, less performant, and losing half the value
In the docs I see the following:
[quote]
PGresult PQexecParams(PGconn conn,
const char *command,
int nParams,
const Oid *paramTypes,
const char const paramValues,
const int *paramLengths,
const int *paramFormats,
int resultFormat);
[/quote]
Is there a reason why the parameters are int and not unsigned int?
space is immaterial here.
David J.