30 #ifndef LIBPQ_BE_FE_HELPERS_H
31 #define LIBPQ_BE_FE_HELPERS_H
40 #error "libpq may not be used code directly built into the backend"
142 (
errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION),
143 errmsg(
"could not establish connection"),
144 errdetail(
"There are too many open files on the local server."),
145 errhint(
"Raise the server's \"max_files_per_process\" and/or \"ulimit -n\" limits.")));
148 (
errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION),
149 errmsg(
"could not establish connection"),
150 errdetail(
"There are too many open files on the local server."),
151 errhint(
"Raise the server's \"max_files_per_process\" setting.")));
272 const Oid *paramTypes,
273 const char *
const *paramValues,
274 const int *paramLengths,
275 const int *paramFormats,
280 paramLengths, paramFormats, resultFormat))
292 PGresult *
volatile lastResult = NULL;
385 static inline const char *
389 const char *
error = NULL;
392 if (cancel_conn == NULL)
393 return "out of memory";
419 if (cur_timeout <= 0)
421 error =
"cancel request timed out";
long TimestampDifferenceMilliseconds(TimestampTz start_time, TimestampTz stop_time)
TimestampTz GetCurrentTimestamp(void)
Datum now(PG_FUNCTION_ARGS)
static Datum values[MAXATTR]
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void ReleaseExternalFD(void)
bool AcquireExternalFD(void)
PGcancelConn * PQcancelCreate(PGconn *conn)
char * PQcancelErrorMessage(const PGcancelConn *cancelConn)
PostgresPollingStatusType PQcancelPoll(PGcancelConn *cancelConn)
void PQcancelFinish(PGcancelConn *cancelConn)
int PQcancelSocket(const PGcancelConn *cancelConn)
int PQcancelStart(PGcancelConn *cancelConn)
PGconn * PQconnectStartParams(const char *const *keywords, const char *const *values, int expand_dbname)
PGconn * PQconnectStart(const char *conninfo)
PostgresPollingStatusType PQconnectPoll(PGconn *conn)
ConnStatusType PQstatus(const PGconn *conn)
void PQfinish(PGconn *conn)
int PQsocket(const PGconn *conn)
int PQsendQueryParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
ExecStatusType PQresultStatus(const PGresult *res)
int PQconsumeInput(PGconn *conn)
int PQsendQuery(PGconn *conn, const char *query)
int PQisBusy(PGconn *conn)
PGresult * PQgetResult(PGconn *conn)
int WaitLatchOrSocket(Latch *latch, int wakeEvents, pgsocket sock, long timeout, uint32 wait_event_info)
void ResetLatch(Latch *latch)
#define WL_SOCKET_READABLE
#define WL_EXIT_ON_PM_DEATH
#define WL_SOCKET_CONNECTED
#define WL_SOCKET_WRITEABLE
static const char * libpqsrv_cancel(PGconn *conn, TimestampTz endtime)
static PGresult * libpqsrv_exec_params(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat, uint32 wait_event_info)
static void libpqsrv_connect_prepare(void)
static PGconn * libpqsrv_connect(const char *conninfo, uint32 wait_event_info)
static PGresult * libpqsrv_get_result(PGconn *conn, uint32 wait_event_info)
static void libpqsrv_connect_internal(PGconn *conn, uint32 wait_event_info)
static PGresult * libpqsrv_exec(PGconn *conn, const char *query, uint32 wait_event_info)
static void libpqsrv_disconnect(PGconn *conn)
static PGconn * libpqsrv_connect_params(const char *const *keywords, const char *const *values, int expand_dbname, uint32 wait_event_info)
static PGresult * libpqsrv_get_result_last(PGconn *conn, uint32 wait_event_info)
PostgresPollingStatusType
char * pchomp(const char *in)
#define CHECK_FOR_INTERRUPTS()