3#define POSTGRES_ECPG_INTERNAL
140 ecpg_log(
"ecpg_finish: connection %s closed\n",
act->name ?
act->name :
"(null)");
142 for (cache =
act->cache_head; cache; ptr = cache, cache = cache->
next,
ecpg_free(ptr));
154 ecpg_log(
"ecpg_finish: called an extra time\n");
166 ecpg_log(
"ECPGsetcommit on line %d: action \"%s\"; connection \"%s\"\n", lineno,
mode, con->
name);
232 ecpg_log(
"ECPGnoticeReceiver: %s\n", message);
248 sqlca->sqlwarn[2] =
'W';
249 sqlca->sqlwarn[0] =
'W';
252 sqlca->sqlerrm.sqlerrmc[
sizeof(
sqlca->sqlerrm.sqlerrmc) - 1] = 0;
320 ecpg_log(
"ECPGconnect: connection identifier %s is already in use\n",
354 offset +=
strlen(
"postgresql://");
392 ecpg_log(
"ECPGconnect: non-localhost access via sockets on line %d\n", lineno);
410 if (*(
dbname + offset) !=
'\0')
544 if (all_connections ==
NULL)
549 all_connections =
this;
553 ecpg_log(
"ECPGconnect: opening database %s on %s port %s %s%s %s%s\n",
555 host ? host :
"<DEFAULT>",
#define Assert(condition)
static struct connection * ecpg_get_connection_nr(const char *connection_name)
static void ecpg_finish(struct connection *act)
static pthread_mutex_t connections_mutex
void ecpg_pthreads_init(void)
static pthread_key_t actual_connection_key
static struct connection * all_connections
PGconn * ECPGget_PGconn(const char *connection_name)
bool ECPGsetconn(int lineno, const char *connection_name)
bool ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
bool ECPGdisconnect(int lineno, const char *connection_name)
static void ECPGnoticeReceiver(void *arg, const PGresult *result)
static pthread_once_t actual_connection_key_once
static struct connection * actual_connection
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
struct connection * ecpg_get_connection(const char *connection_name)
static void ecpg_actual_connection_init(void)
#define ECPG_WARNING_IN_TRANSACTION
#define ECPG_WARNING_UNKNOWN_PORTAL
#define ECPG_WARNING_PORTAL_EXISTS
#define ECPG_WARNING_NO_TRANSACTION
#define ECPG_OUT_OF_MEMORY
#define ECPG_SQLSTATE_NO_ACTIVE_SQL_TRANSACTION
bool ecpg_check_PQresult(PGresult *results, int lineno, PGconn *connection, enum COMPAT_MODE compat)
bool ecpg_deallocate_all_conn(int lineno, enum COMPAT_MODE c, struct connection *con)
#define ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY
char * ecpg_strdup(const char *string, int lineno, bool *alloc_failed)
char * ecpg_alloc(long size, int lineno)
#define ECPG_SQLSTATE_ECPG_INTERNAL_ERROR
#define ECPG_SQLSTATE_INVALID_CURSOR_NAME
void ecpg_log(const char *format,...) pg_attribute_printf(1
void ecpg_clear_auto_mem(void)
bool ecpg_init(const struct connection *con, const char *connection_name, const int lineno)
#define ECPG_SQLSTATE_ACTIVE_SQL_TRANSACTION
#define ECPG_SQLSTATE_DUPLICATE_CURSOR
void ecpg_init_sqlca(struct sqlca_t *sqlca)
#define ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION
void ecpg_raise(int line, int code, const char *sqlstate, const char *str)
bool ecpg_internal_regression_mode
void ecpg_free(void *ptr)
int errmsg(const char *fmt,...)
PGTransactionStatusType PQtransactionStatus(const PGconn *conn)
ConnStatusType PQstatus(const PGconn *conn)
void PQfinish(PGconn *conn)
PQnoticeReceiver PQsetNoticeReceiver(PGconn *conn, PQnoticeReceiver proc, void *arg)
char * PQerrorMessage(const PGconn *conn)
PGconn * PQconnectdbParams(const char *const *keywords, const char *const *values, int expand_dbname)
PGresult * PQexec(PGconn *conn, const char *query)
struct sqlca_t * ECPGget_sqlca(void)
#define PQresultErrorField
static PgChecksumMode mode
char * last_dir_separator(const char *filename)
#define PG_DIAG_MESSAGE_PRIMARY
int pthread_mutex_unlock(pthread_mutex_t *mp)
int pthread_mutex_lock(pthread_mutex_t *mp)
void pthread_setspecific(pthread_key_t key, void *val)
void * pthread_getspecific(pthread_key_t key)
#define PTHREAD_MUTEX_INITIALIZER
struct ECPGtype_information_cache * cache_head
struct prepared_statement * prep_stmts