16#define POSTGRES_ECPG_INTERNAL
21#include "catalog/pg_type_d.h"
56 buffer_len = 2 * length + 1;
61 if (length == escaped_len)
63 res[0] = res[escaped_len + 1] =
'\'';
64 res[escaped_len + 2] =
'\0';
72 memmove(res + 2, res + 1, escaped_len);
74 res[1] = res[escaped_len + 2] =
'\'';
75 res[escaped_len + 3] =
'\0';
104#ifndef HAVE_USELOCALE
116 for (;
text[p] !=
'\0'; p++)
118 if (
string && !std_strings &&
text[p] ==
'\\')
120 else if (
text[p] ==
'\'')
121 string =
string ?
false :
true;
124 if (
text[p] ==
'$' && isdigit((
unsigned char)
text[p + 1]))
129 for (
i = p + 1; isdigit((
unsigned char)
text[
i]);
i++)
131 if (!isalpha((
unsigned char)
text[
i]) &&
132 isascii((
unsigned char)
text[
i]) &&
text[
i] !=
'_')
153 if (new_entry == NULL)
158 new_entry->
next = *cache;
171 if ((
stmt->connection->cache_head) == NULL)
177#define not_an_array_in_ecpg ECPG_ARRAY_NONE
260 for (cache_entry = (
stmt->connection->cache_head); cache_entry != NULL; cache_entry = cache_entry->
next)
266 array_query =
ecpg_alloc(strlen(
"select typlen from pg_type where oid= and typelem<>0") + 11,
stmt->lineno);
267 if (array_query == NULL)
270 sprintf(array_query,
"select typlen from pg_type where oid=%d and typelem<>0",
type);
271 query =
PQexec(
stmt->connection->connection, array_query);
324 ecpg_log(
"ecpg_store_result on line %d: incorrect number of matches; %d don't fit into array of %ld\n",
359 for (act_tuple = 0; act_tuple < ntuples; act_tuple++)
360 len += strlen(
PQgetvalue(results, act_tuple, act_field)) + 1;
362 len += (ntuples + 1) *
sizeof(
char *);
368 for (act_tuple = 0; act_tuple < ntuples; act_tuple++)
370 int slen = strlen(
PQgetvalue(results, act_tuple, act_field)) + 1;
389 for (act_tuple = 0; act_tuple < ntuples; act_tuple++)
393 ecpg_log(
"ecpg_store_result on line %d: allocating memory for %d tuples\n",
stmt->lineno, ntuples);
418 char **current_string = (
char **) var->
value;
421 char *current_data_location = (
char *) ¤t_string[ntuples + 1];
423 for (act_tuple = 0; act_tuple < ntuples && status; act_tuple++)
425 int len = strlen(
PQgetvalue(results, act_tuple, act_field)) + 1;
433 *current_string = current_data_location;
434 current_data_location +=
len;
440 *current_string = NULL;
444 for (act_tuple = 0; act_tuple < ntuples && status; act_tuple++)
459 sprintf(ptr,
"%s%s",
"NaN", delim);
460 else if (isinf(
value))
463 sprintf(ptr,
"%s%s",
"-Infinity", delim);
465 sprintf(ptr,
"%s%s",
"Infinity", delim);
475 sprintf(ptr,
"%s%s",
"NaN", delim);
476 else if (isinf(
value))
479 sprintf(ptr,
"%s%s",
"-Infinity", delim);
481 sprintf(ptr,
"%s%s",
"Infinity", delim);
498 strcpy(to_data,
"'\\x");
507 char **tobeinserted_p,
bool quote)
509 char *mallocedval = NULL;
510 char *newcopy = NULL;
523 *tobeinserted_p =
"";
531 *tobeinserted_p = NULL;
536 *tobeinserted_p = NULL;
541 *tobeinserted_p = NULL;
545 if (*(
long long int *) var->
ind_value < (
long long) 0)
546 *tobeinserted_p = NULL;
552 *tobeinserted_p = NULL;
558 if (*tobeinserted_p != NULL)
567 if (!(mallocedval =
ecpg_alloc(asize * 20, lineno)))
572 strcpy(mallocedval,
"{");
577 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
582 *tobeinserted_p = mallocedval;
586 if (!(mallocedval =
ecpg_alloc(asize * 20, lineno)))
591 strcpy(mallocedval,
"{");
596 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
601 *tobeinserted_p = mallocedval;
605 if (!(mallocedval =
ecpg_alloc(asize * 20, lineno)))
610 strcpy(mallocedval,
"{");
613 sprintf(mallocedval + strlen(mallocedval),
"%hu,", ((
unsigned short *) var->
value)[
element]);
615 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
618 sprintf(mallocedval,
"%hu", *((
unsigned short *) var->
value));
620 *tobeinserted_p = mallocedval;
624 if (!(mallocedval =
ecpg_alloc(asize * 20, lineno)))
629 strcpy(mallocedval,
"{");
634 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
637 sprintf(mallocedval,
"%u", *((
unsigned int *) var->
value));
639 *tobeinserted_p = mallocedval;
643 if (!(mallocedval =
ecpg_alloc(asize * 20, lineno)))
648 strcpy(mallocedval,
"{");
653 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
658 *tobeinserted_p = mallocedval;
662 if (!(mallocedval =
ecpg_alloc(asize * 20, lineno)))
667 strcpy(mallocedval,
"{");
670 sprintf(mallocedval + strlen(mallocedval),
"%lu,", ((
unsigned long *) var->
value)[
element]);
672 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
675 sprintf(mallocedval,
"%lu", *((
unsigned long *) var->
value));
677 *tobeinserted_p = mallocedval;
681 if (!(mallocedval =
ecpg_alloc(asize * 30, lineno)))
686 strcpy(mallocedval,
"{");
689 sprintf(mallocedval + strlen(mallocedval),
"%lld,", ((
long long int *) var->
value)[
element]);
691 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
694 sprintf(mallocedval,
"%lld", *((
long long int *) var->
value));
696 *tobeinserted_p = mallocedval;
700 if (!(mallocedval =
ecpg_alloc(asize * 30, lineno)))
705 strcpy(mallocedval,
"{");
708 sprintf(mallocedval + strlen(mallocedval),
"%llu,", ((
unsigned long long int *) var->
value)[
element]);
710 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
713 sprintf(mallocedval,
"%llu", *((
unsigned long long int *) var->
value));
715 *tobeinserted_p = mallocedval;
719 if (!(mallocedval =
ecpg_alloc(asize * 25, lineno)))
724 strcpy(mallocedval,
"{");
729 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
734 *tobeinserted_p = mallocedval;
738 if (!(mallocedval =
ecpg_alloc(asize * 25, lineno)))
743 strcpy(mallocedval,
"{");
748 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
753 *tobeinserted_p = mallocedval;
762 strcpy(mallocedval,
"{");
765 sprintf(mallocedval + strlen(mallocedval),
"%c,", (((
bool *) var->
value)[
element]) ?
't' :
'f');
767 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
771 if (var->
offset ==
sizeof(
char))
772 sprintf(mallocedval,
"%c", (*((
char *) var->
value)) ?
't' :
'f');
773 else if (var->
offset ==
sizeof(
int))
774 sprintf(mallocedval,
"%c", (*((
int *) var->
value)) ?
't' :
'f');
779 *tobeinserted_p = mallocedval;
789 if (!(newcopy =
ecpg_alloc(slen + 1, lineno)))
792 strncpy(newcopy, (
char *) var->
value, slen);
793 newcopy[slen] =
'\0';
802 *tobeinserted_p = mallocedval;
808 int slen = strlen((
char *) var->
value);
810 if (!(mallocedval =
ecpg_alloc(slen + 1, lineno)))
813 strncpy(mallocedval, (
char *) var->
value, slen);
814 mallocedval[slen] =
'\0';
816 *tobeinserted_p = mallocedval;
829 *tobeinserted_p = mallocedval;
851 *tobeinserted_p = mallocedval;
897 if (!(newcopy =
ecpg_realloc(mallocedval, strlen(mallocedval) + slen + 2, lineno)))
903 mallocedval = newcopy;
906 memcpy(mallocedval + strlen(mallocedval),
str, slen + 1);
908 strcpy(mallocedval + strlen(mallocedval),
",");
914 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
916 *tobeinserted_p = mallocedval;
944 if (!(newcopy =
ecpg_realloc(mallocedval, strlen(mallocedval) + slen + 2, lineno)))
950 mallocedval = newcopy;
953 memcpy(mallocedval + strlen(mallocedval),
str, slen + 1);
955 strcpy(mallocedval + strlen(mallocedval),
",");
961 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
963 *tobeinserted_p = mallocedval;
991 if (!(newcopy =
ecpg_realloc(mallocedval, strlen(mallocedval) + slen + 2, lineno)))
997 mallocedval = newcopy;
1000 memcpy(mallocedval + strlen(mallocedval),
str, slen + 1);
1002 strcpy(mallocedval + strlen(mallocedval),
",");
1008 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
1010 *tobeinserted_p = mallocedval;
1038 if (!(newcopy =
ecpg_realloc(mallocedval, strlen(mallocedval) + slen + 2, lineno)))
1044 mallocedval = newcopy;
1047 memcpy(mallocedval + strlen(mallocedval),
str, slen + 1);
1049 strcpy(mallocedval + strlen(mallocedval),
",");
1055 strcpy(mallocedval + strlen(mallocedval) - 1,
"}");
1057 *tobeinserted_p = mallocedval;
1079 bool malloced =
false;
1083 else if (!is_binary)
1088 if (value_s != NULL)
1095 value_s =
"no memory for logging of parameter";
1098 ecpg_log(
"ecpg_free_params on line %d: parameter %d = %s\n",
1099 lineno, nth, value_s);
1110 for (n = 0; n <
stmt->nparams; n++)
1114 stmt->paramformats[n],
stmt->lineno, n + 1);
1120 stmt->paramvalues = NULL;
1121 stmt->paramlengths = NULL;
1122 stmt->paramformats = NULL;
1131 if (!(newcopy =
ecpg_alloc(strlen(
stmt->command) + strlen(tobeinserted) + 1,
stmt->lineno)))
1137 strcpy(newcopy,
stmt->command);
1138 strcpy(newcopy + position - 1, tobeinserted);
1150 stmt->command = newcopy;
1158 char **tobeinserted)
1171 memcpy(*tobeinserted, desc_item->
data, desc_item->
data_len);
1214 int desc_counter = 0;
1217 bool std_strings =
false;
1238 tobeinserted = NULL;
1240 binary_format =
false;
1260 for (desc_item = desc->
items; desc_item; desc_item = desc_item->
next)
1262 if (desc_item->
num != desc_counter)
1270 binary_length = desc_item->
data_len;
1271 binary_format =
true;
1275 if (desc->
count == desc_counter)
1290 for (
i = 0;
i < sqlda->
sqld;
i++)
1292 if (
i + 1 == desc_counter)
1297 switch (desc_inlist.type)
1304 desc_inlist.varcharsize = 0;
1307 desc_inlist.arrsize = 1;
1308 desc_inlist.offset = 0;
1317 desc_inlist.ind_varcharsize = desc_inlist.ind_arrsize = 1;
1318 desc_inlist.ind_offset = 0;
1323 desc_inlist.ind_value = desc_inlist.ind_pointer = NULL;
1324 desc_inlist.ind_varcharsize = desc_inlist.ind_arrsize = desc_inlist.ind_offset = 0;
1332 if (sqlda->
sqld == desc_counter)
1345 for (
i = 0;
i < sqlda->
sqln;
i++)
1347 if (
i + 1 == desc_counter)
1352 switch (desc_inlist.type)
1359 desc_inlist.varcharsize = 0;
1362 desc_inlist.arrsize = 1;
1363 desc_inlist.offset = 0;
1372 desc_inlist.ind_varcharsize = desc_inlist.ind_arrsize = 1;
1373 desc_inlist.ind_offset = 0;
1378 desc_inlist.ind_value = desc_inlist.ind_pointer = NULL;
1379 desc_inlist.ind_varcharsize = desc_inlist.ind_arrsize = desc_inlist.ind_offset = 0;
1387 if (sqlda->
sqln == desc_counter)
1399 binary_format =
true;
1407 if ((position =
next_insert(
stmt->command, position,
stmt->questionmarks, std_strings) + 1) == 0)
1428 int ph_len = (
stmt->command[position] ==
'?') ? strlen(
"?") : strlen(
"$1");
1435 tobeinserted = NULL;
1443 else if (
stmt->command[position] ==
'0')
1468 tobeinserted = NULL;
1492 tobeinserted = NULL;
1496 bool realloc_failed =
false;
1497 char **newparamvalues;
1498 int *newparamlengths;
1499 int *newparamformats;
1502 if ((newparamvalues = (
char **)
ecpg_realloc(
stmt->paramvalues,
sizeof(
char *) * (
stmt->nparams + 1),
stmt->lineno)))
1503 stmt->paramvalues = newparamvalues;
1505 realloc_failed =
true;
1508 stmt->paramlengths = newparamlengths;
1510 realloc_failed =
true;
1513 stmt->paramformats = newparamformats;
1515 realloc_failed =
true;
1525 stmt->paramvalues[
stmt->nparams] = tobeinserted;
1526 stmt->paramlengths[
stmt->nparams] = binary_length;
1527 stmt->paramformats[
stmt->nparams] = (binary_format ? 1 : 0);
1531 if (
stmt->command[position] ==
'?')
1534 int buffersize =
sizeof(int) * CHAR_BIT * 10 / 3;
1543 snprintf(tobeinserted, buffersize,
"$%d", counter++);
1550 tobeinserted = NULL;
1554 if (desc_counter == 0)
1583 stmt->results =
PQexec(
stmt->connection->connection,
"begin transaction");
1590 stmt->results = NULL;
1602 ecpg_log(
"ecpg_execute on line %d: query: %s; with %d parameter(s) on connection %s\n",
stmt->lineno,
stmt->command,
stmt->nparams,
stmt->connection->name);
1608 (
const char *
const *)
stmt->paramvalues,
1609 (
const int *)
stmt->paramlengths,
1610 (
const int *)
stmt->paramformats,
1612 ecpg_log(
"ecpg_execute on line %d: using PQexecPrepared for \"%s\"\n",
stmt->lineno,
stmt->command);
1616 if (
stmt->nparams == 0)
1619 ecpg_log(
"ecpg_execute on line %d: using PQexec\n",
stmt->lineno);
1624 stmt->command,
stmt->nparams, NULL,
1625 (
const char *
const *)
stmt->paramvalues,
1626 (
const int *)
stmt->paramlengths,
1627 (
const int *)
stmt->paramformats,
1630 ecpg_log(
"ecpg_execute on line %d: using PQexecParams\n",
stmt->lineno);
1672 bool status =
false;
1687 var =
stmt->outlist;
1694 ecpg_log(
"ecpg_process_output on line %d: correctly got %d tuples with %d fields\n",
stmt->lineno, ntuples, nfields);
1700 ecpg_log(
"ecpg_process_output on line %d: incorrect number of matches (%d)\n",
1701 stmt->lineno, ntuples);
1717 clear_result =
false;
1718 ecpg_log(
"ecpg_process_output on line %d: putting result (%d tuples) into descriptor %s\n",
1738 sqlda_new = sqlda->desc_next;
1742 *_sqlda = sqlda = sqlda_new = NULL;
1743 for (
i = ntuples - 1;
i >= 0;
i--)
1756 sqlda_new = sqlda->desc_next;
1762 ecpg_log(
"ecpg_process_output on line %d: out of memory allocating a new sqlda\n",
stmt->lineno);
1768 ecpg_log(
"ecpg_process_output on line %d: new sqlda was built\n",
stmt->lineno);
1770 *_sqlda = sqlda_new;
1773 ecpg_log(
"ecpg_process_output on line %d: putting result (1 tuple %d fields) into sqlda descriptor\n",
1776 sqlda_new->desc_next = sqlda;
1794 sqlda_new = sqlda->desc_next;
1798 *_sqlda = sqlda = sqlda_new = NULL;
1799 for (
i = ntuples - 1;
i >= 0;
i--)
1812 sqlda_new = sqlda->desc_next;
1818 ecpg_log(
"ecpg_process_output on line %d: out of memory allocating a new sqlda\n",
stmt->lineno);
1824 ecpg_log(
"ecpg_process_output on line %d: new sqlda was built\n",
stmt->lineno);
1826 *_sqlda = sqlda_new;
1829 ecpg_log(
"ecpg_process_output on line %d: putting result (1 tuple %d fields) into sqlda descriptor\n",
1832 sqlda_new->desc_next = sqlda;
1841 for (act_field = 0; act_field < nfields && status; act_field++)
1855 if (status && var != NULL)
1867 ecpg_log(
"ecpg_process_output on line %d: OK: %s\n",
stmt->lineno, cmdstat);
1869 !
sqlca->sqlerrd[2] &&
1870 (strncmp(cmdstat,
"UPDATE", 6) == 0
1871 || strncmp(cmdstat,
"INSERT", 6) == 0
1872 || strncmp(cmdstat,
"DELETE", 6) == 0))
1880 ecpg_log(
"ecpg_process_output on line %d: COPY OUT data transfer in progress\n",
stmt->lineno);
1893 ecpg_log(
"ecpg_process_output on line %d: got PGRES_COMMAND_OK after PGRES_COPY_OUT\n",
stmt->lineno);
1905 ecpg_log(
"ecpg_process_output on line %d: unknown execution status type\n",
1915 stmt->results = NULL;
1920 while ((notify =
PQnotifies(
stmt->connection->connection)) != NULL)
1922 ecpg_log(
"ecpg_process_output on line %d: asynchronous notification of \"%s\" from backend PID %d received\n",
1952 bool is_prepared_name_set;
1966 if (!
ecpg_init(con, connection_name, lineno))
1980#ifdef HAVE_USELOCALE
1987 stmt->oldlocale = uselocale(ecpg_clocale);
1995 stmt->oldthreadlocale = _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
1996 if (
stmt->oldthreadlocale == -1)
2004 if (
stmt->oldlocale == NULL)
2028 stmt->command = prepname;
2067 stmt->connection = con;
2096 is_prepared_name_set =
false;
2195 is_prepared_name_set =
true;
2235#ifdef HAVE_USELOCALE
2237 uselocale(
stmt->oldlocale);
2239 if (
stmt->oldlocale)
2243 _configthreadlocale(
stmt->oldthreadlocale);
2296 va_start(
args, query);
void print(const void *obj)
#define ESCAPE_STRING_SYNTAX
void ecpg_pthreads_init(void)
struct connection * ecpg_get_connection(const char *connection_name)
unsigned ecpg_hex_enc_len(unsigned srclen)
bool ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, enum ECPGttype type, enum ECPGttype ind_type, char *var, char *ind, long varcharsize, long offset, long ind_offset, enum ARRAY_TYPE isarray, enum COMPAT_MODE compat, bool force_indicator)
unsigned ecpg_hex_encode(const char *src, unsigned len, char *dst)
#define ECPG_CONVERT_BOOL
#define ECPG_TOO_MANY_ARGUMENTS
#define ECPG_TOO_FEW_ARGUMENTS
#define ECPG_INVALID_STMT
#define ECPG_INFORMIX_SUBSELECT_NOT_ONE
#define ECPG_TOO_MANY_MATCHES
#define ECPG_OUT_OF_MEMORY
struct descriptor * ecpg_find_desc(int line, const char *name)
bool ecpg_check_PQresult(PGresult *results, int lineno, PGconn *connection, enum COMPAT_MODE compat)
#define ECPG_SQLSTATE_NO_DATA
#define ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY
@ ECPG_COMPAT_INFORMIX_SE
char * ecpg_strdup(const char *string, int lineno, bool *alloc_failed)
char * ecpg_alloc(long size, int lineno)
#define ECPG_SQLSTATE_ECPG_INTERNAL_ERROR
struct sqlda_struct * ecpg_build_native_sqlda(int line, PGresult *res, int row, enum COMPAT_MODE compat)
char * ecpg_auto_alloc(long size, int lineno)
bool ecpg_register_prepared_stmt(struct statement *stmt)
void ecpg_log(const char *format,...) pg_attribute_printf(1
void bool ecpg_auto_prepare(int lineno, const char *connection_name, const int compat, char **name, const char *query)
void ecpg_clear_auto_mem(void)
bool ecpg_init(const struct connection *con, const char *connection_name, const int lineno)
#define ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_PARAMETERS
struct sqlda_compat * ecpg_build_compat_sqlda(int line, PGresult *res, int row, enum COMPAT_MODE compat)
#define ECPG_SQLSTATE_CARDINALITY_VIOLATION
char * ecpg_prepared(const char *name, struct connection *con)
void ecpg_set_compat_sqlda(int lineno, struct sqlda_compat **_sqlda, const PGresult *res, int row, enum COMPAT_MODE compat)
char * ecpg_realloc(void *ptr, long size, int lineno)
#define ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_TARGETS
const char * ecpg_type_name(enum ECPGttype typ)
#define ECPG_SQLSTATE_DATATYPE_MISMATCH
void ecpg_set_native_sqlda(int lineno, struct sqlda_struct **_sqlda, const PGresult *res, int row, enum COMPAT_MODE compat)
int ecpg_dynamic_type(Oid type)
void ecpg_raise(int line, int code, const char *sqlstate, const char *str)
void ecpg_free(void *ptr)
void ecpg_raise_backend(int line, PGresult *result, PGconn *conn, int compat)
#define ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME
@ ECPGst_exec_with_exprlist
@ ECPGt_unsigned_long_long
static bool ecpg_type_infocache_push(struct ECPGtype_information_cache **cache, int oid, enum ARRAY_TYPE isarray, int lineno)
bool ecpg_build_params(struct statement *stmt)
bool ecpg_store_result(const PGresult *results, int act_field, const struct statement *stmt, struct variable *var)
static void sprintf_double_value(char *ptr, double value, const char *delim)
static void print_param_value(char *value, int len, int is_binary, int lineno, int nth)
static bool insert_tobeinserted(int position, int ph_len, struct statement *stmt, char *tobeinserted)
bool ecpg_execute(struct statement *stmt)
static char * quote_postgres(char *arg, bool quote, int lineno)
void ecpg_free_params(struct statement *stmt, bool print)
static char * convert_bytea_to_string(char *from_data, int from_len, int lineno)
static enum ARRAY_TYPE ecpg_is_type_an_array(int type, const struct statement *stmt, const struct variable *var)
bool ecpg_store_input(const int lineno, const bool force_indicator, const struct variable *var, char **tobeinserted_p, bool quote)
static bool store_input_from_desc(struct statement *stmt, struct descriptor_item *desc_item, char **tobeinserted)
static void sprintf_float_value(char *ptr, float value, const char *delim)
void ecpg_do_epilogue(struct statement *stmt)
bool ecpg_do(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query, va_list args)
static void free_variable(struct variable *var)
bool ecpg_do_prologue(int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, enum ECPG_statement_type statement_type, const char *query, va_list args, struct statement **stmt_out)
bool ecpg_process_output(struct statement *stmt, bool clear_result)
bool ecpg_autostart_transaction(struct statement *stmt)
bool ECPGdo_descriptor(int line, const char *connection, const char *descriptor, const char *query)
static void free_statement(struct statement *stmt)
#define not_an_array_in_ecpg
static int next_insert(char *text, int pos, bool questionmarks, bool std_strings)
bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...)
PGTransactionStatusType PQtransactionStatus(const PGconn *conn)
const char * PQparameterStatus(const PGconn *conn, const char *paramName)
void PQfreemem(void *ptr)
Oid PQftype(const PGresult *res, int field_num)
PGresult * PQexecParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
PGresult * PQexecPrepared(PGconn *conn, const char *stmtName, int nParams, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
int PQfformat(const PGresult *res, int field_num)
size_t PQescapeString(char *to, const char *from, size_t length)
int PQconsumeInput(PGconn *conn)
PGresult * PQexec(PGconn *conn, const char *query)
Oid PQoidValue(const PGresult *res)
PGnotify * PQnotifies(PGconn *conn)
int PQgetCopyData(PGconn *conn, char **buffer, int async)
Assert(PointerIsAligned(start, uint64))
struct sqlca_t * ECPGget_sqlca(void)
bool ECPGis_noind_null(enum ECPGttype type, const void *ptr)
if(TABLE==NULL||TABLE_index==NULL)
#define PQresultErrorMessage
char * PGTYPESdate_to_asc(date dDate)
char * PGTYPESinterval_to_asc(interval *span)
int PGTYPESnumeric_copy(numeric *src, numeric *dst)
int PGTYPESnumeric_from_decimal(decimal *src, numeric *dst)
numeric * PGTYPESnumeric_new(void)
char * PGTYPESnumeric_to_asc(numeric *num, int dscale)
void PGTYPESnumeric_free(numeric *var)
char * PGTYPEStimestamp_to_asc(timestamp tstamp)
static chr element(struct vars *v, const chr *startp, const chr *endp)
struct descriptor_item * next
struct descriptor_item * items
struct sqlvar_compat * sqlvar
struct sqlvar_struct sqlvar[1]
enum ECPG_statement_type statement_type