39 "PGRES_NONFATAL_ERROR",
55 const char **errmsgp);
62 const Oid *paramTypes,
63 const char *
const *paramValues,
64 const int *paramLengths,
65 const int *paramFormats,
72 const char *desc_target);
129 #define PGRESULT_DATA_BLOCKSIZE 2048 130 #define PGRESULT_ALIGN_BOUNDARY MAXIMUM_ALIGNOF 131 #define PGRESULT_BLOCK_OVERHEAD Max(sizeof(PGresult_data), PGRESULT_ALIGN_BOUNDARY) 132 #define PGRESULT_SEP_ALLOC_THRESHOLD (PGRESULT_DATA_BLOCKSIZE / 2) 239 if (numAttributes <= 0 || !attDescs)
327 for (tup = 0; tup < src->
ntups; tup++)
360 for (i = 0; i < dest->
nEvents; i++)
394 if (!events || count <= 0)
397 msize = count *
sizeof(
PGEvent);
402 for (i = 0; i < count; i++)
404 newEvents[
i].proc = events[
i].
proc;
406 newEvents[
i].data = NULL;
407 newEvents[
i].resultInitialized =
false;
408 newEvents[
i].name = strdup(events[i].
name);
409 if (!newEvents[i].name)
412 free(newEvents[i].name);
416 msize += strlen(events[i].name) + 1;
435 const char *
errmsg = NULL;
442 if (tup_num < 0 || tup_num > res->
ntups)
445 "row number %d is out of range 0..%d",
446 tup_num, res->
ntups);
451 if (tup_num == res->
ntups)
475 attval = &res->
tuples[tup_num][field_num];
478 if (len ==
NULL_LEN || value == NULL)
494 memcpy(attval->
value, value, len);
495 attval->
value[len] =
'\0';
649 char *space = (
char *)
pqResultAlloc(res, strlen(str) + 1,
false);
684 for (i = 0; i < res->
nEvents; i++)
702 while ((block = res->
curBlock) != NULL)
834 msgBuf[
sizeof(msgBuf) - 1] =
'\0';
840 res->noticeHooks = *hooks;
854 res->errMsg = (
char *)
pqResultAlloc(res, strlen(msgBuf) + 2,
false);
857 sprintf(res->errMsg,
"%s\n", msgBuf);
862 res->noticeHooks.noticeRec(res->noticeHooks.noticeRecArg, res);
904 *errmsgp =
libpq_gettext(
"PGresult cannot support more than INT_MAX tuples");
913 #if INT_MAX >= (SIZE_MAX / 2) 976 for (pstatus = conn->
pstatus, prev = NULL;
978 prev = pstatus, pstatus = pstatus->
next)
980 if (strcmp(pstatus->
name, name) == 0)
995 strlen(name) + strlen(value) + 2);
1001 pstatus->
name = ptr;
1003 ptr += strlen(name) + 1;
1004 pstatus->
value = ptr;
1017 if (strcmp(name,
"client_encoding") == 0)
1025 else if (strcmp(name,
"standard_conforming_strings") == 0)
1030 else if (strcmp(name,
"server_version") == 0)
1038 cnt = sscanf(value,
"%d.%d.%d", &vmaj, &vmin, &vrev);
1043 conn->
sversion = (100 * vmaj + vmin) * 100 + vrev;
1050 conn->
sversion = 100 * 100 * vmaj + vmin;
1055 conn->
sversion = (100 * vmaj + vmin) * 100;
1066 else if (strcmp(name,
"default_transaction_read_only") == 0)
1071 else if (strcmp(name,
"in_hot_standby") == 0)
1130 for (i = 0; i < nfields; i++)
1132 int clen = columns[
i].
len;
1150 memcpy(val, columns[i].
value, clen);
1225 pqPuts(query, conn) < 0 ||
1262 const char *command,
1264 const Oid *paramTypes,
1265 const char *
const *paramValues,
1266 const int *paramLengths,
1267 const int *paramFormats,
1280 if (nParams < 0 || nParams > 65535)
1283 libpq_gettext(
"number of parameters must be between 0 and 65535\n"));
1307 const char *stmtName,
const char *query,
1308 int nParams,
const Oid *paramTypes)
1326 if (nParams < 0 || nParams > 65535)
1329 libpq_gettext(
"number of parameters must be between 0 and 65535\n"));
1335 pqPuts(stmtName, conn) < 0 ||
1339 if (nParams > 0 && paramTypes)
1343 if (
pqPutInt(nParams, 2, conn) < 0)
1345 for (i = 0; i < nParams; i++)
1347 if (
pqPutInt(paramTypes[i], 4, conn) < 0)
1396 const char *stmtName,
1398 const char *
const *paramValues,
1399 const int *paramLengths,
1400 const int *paramFormats,
1413 if (nParams < 0 || nParams > 65535)
1416 libpq_gettext(
"number of parameters must be between 0 and 65535\n"));
1480 const char *command,
1481 const char *stmtName,
1483 const Oid *paramTypes,
1484 const char *
const *paramValues,
1485 const int *paramLengths,
1486 const int *paramFormats,
1500 pqPuts(stmtName, conn) < 0 ||
1501 pqPuts(command, conn) < 0)
1503 if (nParams > 0 && paramTypes)
1505 if (
pqPutInt(nParams, 2, conn) < 0)
1507 for (i = 0; i < nParams; i++)
1509 if (
pqPutInt(paramTypes[i], 4, conn) < 0)
1525 pqPuts(stmtName, conn) < 0)
1529 if (nParams > 0 && paramFormats)
1531 if (
pqPutInt(nParams, 2, conn) < 0)
1533 for (i = 0; i < nParams; i++)
1535 if (
pqPutInt(paramFormats[i], 2, conn) < 0)
1545 if (
pqPutInt(nParams, 2, conn) < 0)
1549 for (i = 0; i < nParams; i++)
1551 if (paramValues && paramValues[i])
1555 if (paramFormats && paramFormats[i] != 0)
1559 nbytes = paramLengths[
i];
1563 libpq_gettext(
"length must be given for binary parameter\n"));
1570 nbytes = strlen(paramValues[i]);
1572 if (
pqPutInt(nbytes, 4, conn) < 0 ||
1573 pqPutnchar(paramValues[i], nbytes, conn) < 0)
1757 while ((flushResult =
pqFlush(conn)) > 0)
1759 if (
pqWait(
false,
true, conn))
1774 pqWait(
true,
false, conn) ||
1833 for (i = 0; i < res->
nEvents; i++)
1843 libpq_gettext(
"PGEventProc \"%s\" failed during PGEVT_RESULTCREATE event\n"),
1914 const char *command,
1916 const Oid *paramTypes,
1917 const char *
const *paramValues,
1918 const int *paramLengths,
1919 const int *paramFormats,
1925 nParams, paramTypes, paramValues, paramLengths,
1926 paramFormats, resultFormat))
1944 const char *stmtName,
const char *query,
1945 int nParams,
const Oid *paramTypes)
1949 if (!
PQsendPrepare(conn, stmtName, query, nParams, paramTypes))
1961 const char *stmtName,
1963 const char *
const *paramValues,
1964 const int *paramLengths,
1965 const int *paramFormats,
1971 nParams, paramValues, paramLengths,
1972 paramFormats, resultFormat))
2060 lastResult = result;
2160 pqPutc(desc_type, conn) < 0 ||
2161 pqPuts(desc_target, conn) < 0 ||
2314 pqPuts(errormsg, conn) < 0 ||
2402 if (!s || maxlen <= 0)
2553 result_buf, result_len,
2580 if (!res || !res->
errMsg)
2600 return strdup(
libpq_gettext(
"PGresult is not an error result\n"));
2613 return workBuf.
data;
2623 for (pfield = res->
errFields; pfield != NULL; pfield = pfield->
next)
2625 if (pfield->
code == fieldcode)
2668 "column number %d is out of range 0..%d",
2677 int tup_num,
int field_num)
2681 if (tup_num < 0 || tup_num >= res->
ntups)
2684 "row number %d is out of range 0..%d",
2685 tup_num, res->
ntups - 1);
2691 "column number %d is out of range 0..%d",
2706 "parameter number %d is out of range 0..%d",
2744 bool all_lower =
true;
2756 if (field_name == NULL ||
2757 field_name[0] ==
'\0' ||
2765 for (iptr = field_name; *iptr; iptr++)
2769 if (c ==
'"' || c !=
pg_tolower((
unsigned char) c))
2788 field_case = strdup(field_name);
2789 if (field_case == NULL)
2794 for (iptr = field_case; *iptr; iptr++)
2922 static char buf[24];
2926 if (!res || strncmp(res->
cmdStatus,
"INSERT ", 7) != 0)
2929 len = strspn(res->
cmdStatus + 7,
"0123456789");
2930 if (len >
sizeof(buf) - 1)
2931 len =
sizeof(
buf) - 1;
2946 char *endptr = NULL;
2947 unsigned long result;
2950 strncmp(res->
cmdStatus,
"INSERT ", 7) != 0 ||
2955 result = strtoul(res->
cmdStatus + 7, &endptr, 10);
2957 if (!endptr || (*endptr !=
' ' && *endptr !=
'\0'))
2960 return (
Oid) result;
2981 if (strncmp(res->
cmdStatus,
"INSERT ", 7) == 0)
2985 while (*p && *p !=
' ')
2988 goto interpret_error;
2991 else if (strncmp(res->
cmdStatus,
"SELECT ", 7) == 0 ||
2992 strncmp(res->
cmdStatus,
"DELETE ", 7) == 0 ||
2993 strncmp(res->
cmdStatus,
"UPDATE ", 7) == 0)
2995 else if (strncmp(res->
cmdStatus,
"FETCH ", 6) == 0)
2997 else if (strncmp(res->
cmdStatus,
"MOVE ", 5) == 0 ||
2998 strncmp(res->
cmdStatus,
"COPY ", 5) == 0)
3004 for (c = p; *
c; c++)
3006 if (!isdigit((
unsigned char) *c))
3007 goto interpret_error;
3010 goto interpret_error;
3016 "could not interpret result from server: %s",
3042 return res->
tuples[tup_num][field_num].
len;
3101 barg = (arg ?
true :
false);
3140 #ifdef ENABLE_THREAD_SAFETY 3203 char *to,
const char *from,
size_t length,
3207 const char *
source = from;
3214 while (remaining > 0 && *source !=
'\0')
3237 for (i = 0; i < len; i++)
3239 if (remaining == 0 || *source ==
'\0')
3241 *target++ = *source++;
3260 for (; i < len; i++)
3262 if (((
size_t) (target - to)) / 2 >= length)
3278 char *to,
const char *from,
size_t length,
3319 int num_backslashes = 0;
3322 char quote_char = as_ident ?
'"' :
'\'';
3331 for (s = str; (s -
str) < len && *s !=
'\0'; ++s)
3333 if (*s == quote_char)
3335 else if (*s ==
'\\')
3345 if ((s - str) + charlen > len || memchr(s, 0, charlen) != NULL)
3358 input_len = s -
str;
3359 result_size = input_len + num_quotes + 3;
3360 if (!as_ident && num_backslashes > 0)
3361 result_size += num_backslashes + 2;
3362 result = rp = (
char *)
malloc(result_size);
3377 if (!as_ident && num_backslashes > 0)
3397 if (num_quotes == 0 && (num_backslashes == 0 || as_ident))
3399 memcpy(rp, str, input_len);
3404 for (s = str; s - str < input_len; ++s)
3406 if (*s == quote_char || (!as_ident && *s ==
'\\'))
3448 static const char hextbl[] =
"0123456789abcdef";
3451 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3452 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3453 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3454 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
3455 -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3456 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3457 -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3458 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3466 if (c > 0 && c < 127)
3488 static unsigned char *
3490 const unsigned char *from,
size_t from_length,
3491 size_t *to_length,
bool std_strings,
bool use_hex)
3493 const unsigned char *vp;
3495 unsigned char *result;
3498 size_t bslash_len = (std_strings ? 1 : 2);
3507 len += bslash_len + 1 + 2 * from_length;
3512 for (i = from_length; i > 0; i--, vp++)
3514 if (*vp < 0x20 || *vp > 0x7e)
3515 len += bslash_len + 3;
3516 else if (*vp ==
'\'')
3518 else if (*vp ==
'\\')
3519 len += bslash_len + bslash_len;
3526 rp = result = (
unsigned char *)
malloc(len);
3544 for (i = from_length; i > 0; i--, vp++)
3546 unsigned char c = *vp;
3550 *rp++ =
hextbl[(c >> 4) & 0xF];
3558 *rp++ = (c >> 6) +
'0';
3559 *rp++ = ((c >> 3) & 07) +
'0';
3560 *rp++ = (c & 07) +
'0';
3587 const unsigned char *from,
size_t from_length,
3609 #define ISFIRSTOCTDIGIT(CH) ((CH) >= '0' && (CH) <= '3') 3610 #define ISOCTDIGIT(CH) ((CH) >= '0' && (CH) <= '7') 3611 #define OCTVAL(CH) ((CH) - '0') 3630 unsigned char *buffer,
3635 if (strtext == NULL)
3638 strtextlen = strlen((
const char *) strtext);
3640 if (strtext[0] ==
'\\' && strtext[1] ==
'x')
3642 const unsigned char *s;
3645 buflen = (strtextlen - 2) / 2;
3647 buffer = (
unsigned char *)
malloc(buflen > 0 ? buflen : 1);
3663 if (!*s || v1 == (
char) -1)
3666 if (v2 != (
char) -1)
3667 *p++ = (v1 << 4) | v2;
3670 buflen = p - buffer;
3678 buffer = (
unsigned char *)
malloc(strtextlen + 1);
3682 for (i = j = 0; i < strtextlen;)
3688 if (strtext[i] ==
'\\')
3689 buffer[j++] = strtext[i++];
3698 byte =
OCTVAL(strtext[i++]);
3699 byte = (byte << 3) +
OCTVAL(strtext[i++]);
3700 byte = (byte << 3) +
OCTVAL(strtext[i++]);
3715 buffer[j++] = strtext[i++];
3724 tmpbuf =
realloc(buffer, buflen + 1);
3733 *retbuflen = buflen;
int PQputCopyData(PGconn *conn, const char *buffer, int nbytes)
int pqFlush(PGconn *conn)
int pqRowProcessor(PGconn *conn, const char **errmsgp)
static bool static_std_strings
int PQgetlength(const PGresult *res, int tup_num, int field_num)
PGresult * PQexecPrepared(PGconn *conn, const char *stmtName, int nParams, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
int PQnfields(const PGresult *res)
PGresult * PQprepare(PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes)
PGresult * PQdescribePrepared(PGconn *conn, const char *stmt)
PGMessageField * errFields
int PQftablecol(const PGresult *res, int field_num)
size_t PQresultMemorySize(const PGresult *res)
int pg_char_to_encoding(const char *name)
int PQisnonblocking(const PGconn *conn)
#define PG_DIAG_MESSAGE_PRIMARY
#define ISFIRSTOCTDIGIT(CH)
size_t PQescapeString(char *to, const char *from, size_t length)
int PQsendQueryParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
int pqGetline3(PGconn *conn, char *s, int maxlen)
char * PQgetvalue(const PGresult *res, int tup_num, int field_num)
int pqCheckOutBufferSpace(size_t bytes_needed, PGconn *conn)
static int check_tuple_field_number(const PGresult *res, int tup_num, int field_num)
int PQfsize(const PGresult *res, int field_num)
PGnotify * PQnotifies(PGconn *conn)
char * PQfname(const PGresult *res, int field_num)
void pqSaveParameterStatus(PGconn *conn, const char *name, const char *value)
static int check_param_number(const PGresult *res, int param_num)
void termPQExpBuffer(PQExpBuffer str)
#define pqIsnonblocking(conn)
char * PQcmdTuples(PGresult *res)
PGresult * pqFunctionCall3(PGconn *conn, Oid fnid, int *result_buf, int *actual_result_len, int result_is_int, const PQArgBlock *args, int nargs)
void appendPQExpBufferStr(PQExpBuffer str, const char *data)
int PQputnbytes(PGconn *conn, const char *buffer, int nbytes)
int PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len)
Oid PQoidValue(const PGresult *res)
Oid PQftable(const PGresult *res, int field_num)
int PQsendDescribePortal(PGconn *conn, const char *portal)
static int PQsendQueryGuts(PGconn *conn, const char *command, const char *stmtName, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
PGresult * PQcopyResult(const PGresult *src, int flags)
union pgresult_data PGresult_data
char * PQresStatus(ExecStatusType status)
Oid PQparamtype(const PGresult *res, int param_num)
int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize)
unsigned char pg_tolower(unsigned char ch)
int PQputCopyEnd(PGconn *conn, const char *errormsg)
struct pgMessageField * next
PGresult * PQdescribePortal(PGconn *conn, const char *portal)
int PQbinaryTuples(const PGresult *res)
char * PQoidStatus(const PGresult *res)
int PQntuples(const PGresult *res)
PGresult * PQfn(PGconn *conn, int fnid, int *result_buf, int *result_len, int result_is_int, const PQArgBlock *args, int nargs)
PGresult * pqPrepareAsyncResult(PGconn *conn)
ExecStatusType PQresultStatus(const PGresult *res)
#define PG_COPYRES_TUPLES
int PQgetCopyData(PGconn *conn, char **buffer, int async)
static int PQsendDescribe(PGconn *conn, char desc_type, const char *desc_target)
int pqPutInt(int value, size_t bytes, PGconn *conn)
int PQputline(PGconn *conn, const char *s)
int pqGetlineAsync3(PGconn *conn, char *buffer, int bufsize)
static char get_hex(char c)
#define PGRESULT_ALIGN_BOUNDARY
int PQsendQuery(PGconn *conn, const char *query)
char * PQescapeIdentifier(PGconn *conn, const char *str, size_t len)
PGAsyncStatusType asyncStatus
struct pg_result PGresult
PGTernaryBool default_transaction_read_only
#define IS_HIGHBIT_SET(ch)
#define PG_COPYRES_EVENTS
int pqEndcopy3(PGconn *conn)
static bool pqAddTuple(PGresult *res, PGresAttValue *tup, const char **errmsgp)
void PQfreeNotify(PGnotify *notify)
PGNoticeHooks noticeHooks
#define PG_COPYRES_NOTICEHOOKS
struct pgParameterStatus pgParameterStatus
void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...)
PGNoticeHooks noticeHooks
int PQflush(PGconn *conn)
Oid PQftype(const PGresult *res, int field_num)
int pqReadData(PGconn *conn)
int PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs)
char * PQresultVerboseErrorMessage(const PGresult *res, PGVerbosity verbosity, PGContextVisibility show_context)
static const int8 hexlookup[128]
static bool PQsendQueryStart(PGconn *conn, bool newQuery)
static int static_client_encoding
int pqWait(int forRead, int forWrite, PGconn *conn)
#define PGRESULT_BLOCK_OVERHEAD
int PQsetSingleRowMode(PGconn *conn)
static PGresult * getCopyResult(PGconn *conn, ExecStatusType copytype)
PQnoticeReceiver noticeRec
int pg_encoding_mblen(int encoding, const char *mbstr)
void pqInternalNotice(const PGNoticeHooks *hooks, const char *fmt,...)
int PQsendDescribePrepared(PGconn *conn, const char *stmt)
size_t PQescapeStringConn(PGconn *conn, char *to, const char *from, size_t length, int *error)
PGresult * PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status)
int pqPutc(char c, PGconn *conn)
int pqPuts(const char *s, PGconn *conn)
static void parseInput(PGconn *conn)
int pqGetCopyData3(PGconn *conn, char **buffer, int async)
unsigned char * PQunescapeBytea(const unsigned char *strtext, size_t *retbuflen)
char * PQcmdStatus(PGresult *res)
PGTernaryBool in_hot_standby
void pqSaveMessageField(PGresult *res, char code, const char *value)
pgParameterStatus * pstatus
#define PGRESULT_SEP_ALLOC_THRESHOLD
int PQfnumber(const PGresult *res, const char *field_name)
int PQconsumeInput(PGconn *conn)
int PQsetnonblocking(PGconn *conn, int arg)
PQnoticeProcessor noticeProc
int PQgetline(PGconn *conn, char *s, int maxlen)
char * PQescapeLiteral(PGconn *conn, const char *str, size_t len)
PQExpBufferData errorMessage
#define PG_DIAG_SEVERITY_NONLOCALIZED
void pqSetResultError(PGresult *res, const char *msg)
void PQclear(PGresult *res)
static int check_field_number(const PGresult *res, int field_num)
#define PQExpBufferDataBroken(buf)
int PQendcopy(PGconn *conn)
void * pqResultAlloc(PGresult *res, size_t nBytes, bool isBinary)
PGresParamDesc * paramDescs
char * PQresultErrorField(const PGresult *res, int fieldcode)
int pqPutnchar(const char *s, size_t len, PGconn *conn)
static size_t PQescapeStringInternal(PGconn *conn, char *to, const char *from, size_t length, int *error, int encoding, bool std_strings)
int PQisBusy(PGconn *conn)
struct pgParameterStatus * next
static rewind_source * source
char contents[FLEXIBLE_ARRAY_MEMBER]
char cmdStatus[CMDSTATUS_LEN]
int PQfmod(const PGresult *res, int field_num)
int pqPutMsgStart(char msg_type, PGconn *conn)
static char * PQescapeInternal(PGconn *conn, const char *str, size_t len, bool as_ident)
int pqPutMsgEnd(PGconn *conn)
static PGresult * PQexecFinish(PGconn *conn)
int PQsendQueryPrepared(PGconn *conn, const char *stmtName, int nParams, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
static StringInfoData tmpbuf
static void pqSaveWriteError(PGconn *conn)
char * PQresultErrorMessage(const PGresult *res)
#define PGRESULT_DATA_BLOCKSIZE
static bool PQexecStart(PGconn *conn)
PGresult * PQexecParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
int errmsg(const char *fmt,...)
static const char hextbl[]
PGresult * PQexec(PGconn *conn, const char *query)
#define SQL_STR_DOUBLE(ch, escape_backslash)
void pqBuildErrorMessage3(PQExpBuffer msg, const PGresult *res, PGVerbosity verbosity, PGContextVisibility show_context)
char *const pgresStatus[]
int PQsendQueryContinue(PGconn *conn, const char *query)
unsigned char * PQescapeBytea(const unsigned char *from, size_t from_length, size_t *to_length)
void pqClearAsyncResult(PGconn *conn)
void pqSaveErrorResult(PGconn *conn)
static PGEvent * dupEvents(PGEvent *events, int count, size_t *memSize)
void pqParseInput3(PGconn *conn)
void resetPQExpBuffer(PQExpBuffer str)
static void static void status(const char *fmt,...) pg_attribute_printf(1
int PQgetisnull(const PGresult *res, int tup_num, int field_num)
unsigned char * PQescapeByteaConn(PGconn *conn, const unsigned char *from, size_t from_length, size_t *to_length)
static unsigned char * PQescapeByteaInternal(PGconn *conn, const unsigned char *from, size_t from_length, size_t *to_length, bool std_strings, bool use_hex)
int PQfformat(const PGresult *res, int field_num)
ExecStatusType resultStatus
void PQfreemem(void *ptr)
static int PQsendQueryInternal(PGconn *conn, const char *query, bool newQuery)
PGresult * PQgetResult(PGconn *conn)
int PQnparams(const PGresult *res)
void initPQExpBuffer(PQExpBuffer str)
#define offsetof(type, field)
int PQsendPrepare(PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes)
char * pqResultStrdup(PGresult *res, const char *str)
void * PQresultAlloc(PGresult *res, size_t nBytes)