37 #define LIBPQ_HAS_PIPELINING 1
39 #define LIBPQ_HAS_TRACE_FLAGS 1
43 #define LIBPQ_HAS_SSL_LIBRARY_DETECTION 1
47 #define LIBPQ_HAS_ASYNC_CANCEL 1
49 #define LIBPQ_HAS_CHANGE_PASSWORD 1
51 #define LIBPQ_HAS_CHUNK_MODE 1
53 #define LIBPQ_HAS_CLOSE_PREPARED 1
55 #define LIBPQ_HAS_SEND_PIPELINE_SYNC 1
57 #define LIBPQ_HAS_SOCKET_POLL 1
61 #define LIBPQ_HAS_FULL_PROTOCOL_VERSION 1
66 #define PG_COPYRES_ATTRS 0x01
67 #define PG_COPYRES_TUPLES 0x02
68 #define PG_COPYRES_EVENTS 0x04
69 #define PG_COPYRES_NOTICEHOOKS 0x08
315 const char *
const *
values,
int expand_dbname);
321 const char *
const *
values,
int expand_dbname);
323 const char *pgoptions,
const char *pgtty,
325 const char *login,
const char *pwd);
327 #define PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME) \
328 PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL)
398 const char *paramName);
466 #define PQTRACE_SUPPRESS_TIMESTAMPS (1<<0)
468 #define PQTRACE_REGRESS_MODE (1<<1)
478 const Oid *paramTypes,
479 const char *
const *paramValues,
480 const int *paramLengths,
481 const int *paramFormats,
484 const char *query,
int nParams,
485 const Oid *paramTypes);
487 const char *stmtName,
489 const char *
const *paramValues,
490 const int *paramLengths,
491 const int *paramFormats,
495 #define PQ_QUERY_PARAM_MAX_LIMIT 65535
501 const Oid *paramTypes,
502 const char *
const *paramValues,
503 const int *paramLengths,
504 const int *paramFormats,
507 const char *query,
int nParams,
508 const Oid *paramTypes);
510 const char *stmtName,
512 const char *
const *paramValues,
513 const int *paramLengths,
514 const int *paramFormats,
552 const char *
const *
values,
int expand_dbname);
617 #define PQfreeNotify(ptr) PQfreemem(ptr)
621 #define PQnoPasswordSupplied "fe_sendauth: no password supplied\n"
633 char *to,
const char *from,
size_t length,
638 const unsigned char *from,
size_t from_length,
644 extern size_t PQescapeString(
char *to,
const char *from,
size_t length);
645 extern unsigned char *
PQescapeBytea(
const unsigned char *from,
size_t from_length,
652 extern void PQprint(FILE *fout,
662 const char *fieldSep,
700 extern int PQsocketPoll(
int sock,
int forRead,
int forWrite,
static Datum values[MAXATTR]
static PGcancel *volatile cancelConn
static void PGresult * res
int errmsg(const char *fmt,...)
@ CONNECTION_CHECK_STANDBY
@ CONNECTION_AWAITING_RESPONSE
@ CONNECTION_CHECK_WRITABLE
@ CONNECTION_CHECK_TARGET
const char * PQparameterStatus(const PGconn *conn, const char *paramName)
int PQserverVersion(const PGconn *conn)
int PQprotocolVersion(const PGconn *conn)
PQconninfoOption * PQconninfoParse(const char *conninfo, char **errmsg)
unsigned char * PQescapeBytea(const unsigned char *from, size_t from_length, size_t *to_length)
PGresult * PQfn(PGconn *conn, int fnid, int *result_buf, int *result_len, int result_is_int, const PQArgBlock *args, int nargs)
int PQresetStart(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)
int PQgetlength(const PGresult *res, int tup_num, int field_num)
PGcancel * PQgetCancel(PGconn *conn)
int PQsetSingleRowMode(PGconn *conn)
int PQbinaryTuples(const PGresult *res)
int PQflush(PGconn *conn)
void PQfreemem(void *ptr)
PGconn * PQconnectStartParams(const char *const *keywords, const char *const *values, int expand_dbname)
void PQdisplayTuples(const PGresult *res, FILE *fp, int fillAlign, const char *fieldSep, int printHeader, int quiet)
PGnotify * PQnotifies(PGconn *conn)
PGresult * PQprepare(PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes)
int PQgetline(PGconn *conn, char *buffer, int length)
unsigned char * PQunescapeBytea(const unsigned char *strtext, size_t *retbuflen)
void PQinitSSL(int do_init)
Oid PQftype(const PGresult *res, int field_num)
void(* pgthreadlock_t)(int acquire)
int lo_tell(PGconn *conn, int fd)
int PQexitPipelineMode(PGconn *conn)
PGresult * PQchangePassword(PGconn *conn, const char *user, const char *passwd)
char * PQhost(const PGconn *conn)
int PQsendClosePortal(PGconn *conn, const char *portal)
int PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs)
void PQcancelReset(PGcancelConn *cancelConn)
int lo_close(PGconn *conn, int fd)
struct _PQconninfoOption PQconninfoOption
pg_int64 lo_tell64(PGconn *conn, int fd)
PGconn * PQconnectStart(const char *conninfo)
PQsslKeyPassHook_OpenSSL_type PQgetSSLKeyPassHook_OpenSSL(void)
PGconn * PQconnectdbParams(const char *const *keywords, const char *const *values, int expand_dbname)
char * PQdb(const PGconn *conn)
char * PQescapeIdentifier(PGconn *conn, const char *str, size_t len)
int PQfullProtocolVersion(const PGconn *conn)
PGcancelConn * PQcancelCreate(PGconn *conn)
void PQreset(PGconn *conn)
int PQenterPipelineMode(PGconn *conn)
int PQsocketPoll(int sock, int forRead, int forWrite, pg_usec_time_t end_time)
size_t PQescapeStringConn(PGconn *conn, char *to, const char *from, size_t length, int *error)
void PQtrace(PGconn *conn, FILE *debug_port)
PGTransactionStatusType PQtransactionStatus(const 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)
ExecStatusType PQresultStatus(const PGresult *res)
Oid PQparamtype(const PGresult *res, int param_num)
PGresult * PQdescribePrepared(PGconn *conn, const char *stmt)
int PQnparams(const PGresult *res)
int PQdefaultSSLKeyPassHook_OpenSSL(char *buf, int size, PGconn *conn)
char * PQencryptPassword(const char *passwd, const char *user)
int pg_char_to_encoding(const char *name)
void PQprintTuples(const PGresult *res, FILE *fout, int PrintAttNames, int TerseOutput, int colWidth)
void PQclear(PGresult *res)
int PQsendClosePrepared(PGconn *conn, const char *stmt)
char * PQcmdTuples(PGresult *res)
char * PQresultErrorMessage(const PGresult *res)
PQconninfoOption * PQconndefaults(void)
struct _PQprintOpt PQprintOpt
int PQconnectionUsedPassword(const PGconn *conn)
int PQfformat(const PGresult *res, int field_num)
void(* PQnoticeReceiver)(void *arg, const PGresult *res)
PGresult * PQclosePortal(PGconn *conn, const char *portal)
char * PQtty(const PGconn *conn)
void(* PQnoticeProcessor)(void *arg, const char *message)
char * PQhostaddr(const PGconn *conn)
int PQendcopy(PGconn *conn)
int PQgssEncInUse(PGconn *conn)
PostgresPollingStatusType PQconnectPoll(PGconn *conn)
int PQputCopyEnd(PGconn *conn, const char *errormsg)
void PQconninfoFree(PQconninfoOption *connOptions)
Oid lo_creat(PGconn *conn, int mode)
int PQsendPipelineSync(PGconn *conn)
int(* PQsslKeyPassHook_OpenSSL_type)(char *buf, int size, PGconn *conn)
int lo_read(PGconn *conn, int fd, char *buf, size_t len)
int lo_lseek(PGconn *conn, int fd, int offset, int whence)
int PQntuples(const PGresult *res)
int PQputnbytes(PGconn *conn, const char *buffer, int nbytes)
void PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
pg_int64 lo_lseek64(PGconn *conn, int fd, pg_int64 offset, int whence)
int pg_valid_server_encoding_id(int encoding)
int PQmblen(const char *s, int encoding)
int PQputline(PGconn *conn, const char *string)
int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize)
int lo_open(PGconn *conn, Oid lobjId, int mode)
PostgresPollingStatusType
int PQputCopyData(PGconn *conn, const char *buffer, int nbytes)
PGresult * PQexecPrepared(PGconn *conn, const char *stmtName, int nParams, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
ConnStatusType PQcancelStatus(const PGcancelConn *cancelConn)
PQconninfoOption * PQconninfo(PGconn *conn)
int lo_write(PGconn *conn, int fd, const char *buf, size_t len)
char * PQfname(const PGresult *res, int field_num)
int PQconnectionNeedsPassword(const PGconn *conn)
void PQinitOpenSSL(int do_ssl, int do_crypto)
char * PQescapeLiteral(PGconn *conn, const char *str, size_t len)
int PQcancelBlocking(PGcancelConn *cancelConn)
int lo_truncate(PGconn *conn, int fd, size_t len)
PGresult * PQdescribePortal(PGconn *conn, const char *portal)
int PQsendDescribePrepared(PGconn *conn, const char *stmt)
PGresult * PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status)
Oid lo_create(PGconn *conn, Oid lobjId)
PGresult * PQexec(PGconn *conn, const char *query)
unsigned char * PQescapeByteaConn(PGconn *conn, const unsigned char *from, size_t from_length, size_t *to_length)
PostgresPollingStatusType PQresetPoll(PGconn *conn)
int PQsslInUse(PGconn *conn)
int PQconnectionUsedGSSAPI(const PGconn *conn)
size_t PQescapeString(char *to, const char *from, size_t length)
int PQconsumeInput(PGconn *conn)
char * PQerrorMessage(const PGconn *conn)
int PQcancel(PGcancel *cancel, char *errbuf, int errbufsize)
char * PQgetvalue(const PGresult *res, int tup_num, int field_num)
ConnStatusType PQstatus(const PGconn *conn)
Oid PQftable(const PGresult *res, int field_num)
int PQfnumber(const PGresult *res, const char *field_name)
char * PQcmdStatus(PGresult *res)
int PQsetnonblocking(PGconn *conn, int arg)
int PQclientEncoding(const PGconn *conn)
const char *const * PQsslAttributeNames(PGconn *conn)
PGconn * PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions, const char *pgtty, const char *dbName, const char *login, const char *pwd)
void PQfinish(PGconn *conn)
PGPing PQping(const char *conninfo)
int PQsendPrepare(PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes)
PGconn * PQconnectdb(const char *conninfo)
int PQfmod(const PGresult *res, int field_num)
PGContextVisibility PQsetErrorContextVisibility(PGconn *conn, PGContextVisibility show_context)
int PQdsplen(const char *s, int encoding)
int PQgetisnull(const PGresult *res, int tup_num, int field_num)
char * PQuser(const PGconn *conn)
int PQftablecol(const PGresult *res, int field_num)
int PQsetChunkedRowsMode(PGconn *conn, int chunkSize)
char * PQcancelErrorMessage(const PGcancelConn *cancelConn)
void * PQgetssl(PGconn *conn)
int PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len)
void * PQsslStruct(PGconn *conn, const char *struct_name)
char * PQpass(const PGconn *conn)
int PQsendQuery(PGconn *conn, const char *query)
int PQpipelineSync(PGconn *conn)
char * PQresStatus(ExecStatusType status)
PostgresPollingStatusType PQcancelPoll(PGcancelConn *cancelConn)
PQnoticeReceiver PQsetNoticeReceiver(PGconn *conn, PQnoticeReceiver proc, void *arg)
int PQsendDescribePortal(PGconn *conn, const char *portal)
void PQcancelFinish(PGcancelConn *cancelConn)
PGresult * PQclosePrepared(PGconn *conn, const char *stmt)
void PQsetTraceFlags(PGconn *conn, int flags)
size_t PQresultMemorySize(const PGresult *res)
int PQbackendPID(const PGconn *conn)
int PQisBusy(PGconn *conn)
pg_usec_time_t PQgetCurrentTimeUSec(void)
int PQsendQueryPrepared(PGconn *conn, const char *stmtName, int nParams, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
void * PQgetgssctx(PGconn *conn)
int PQsendFlushRequest(PGconn *conn)
int PQrequestCancel(PGconn *conn)
char * PQencryptPasswordConn(PGconn *conn, const char *passwd, const char *user, const char *algorithm)
void PQfreeCancel(PGcancel *cancel)
char * PQoidStatus(const PGresult *res)
char * PQresultErrorField(const PGresult *res, int fieldcode)
char * PQport(const PGconn *conn)
int PQcancelSocket(const PGcancelConn *cancelConn)
PGpipelineStatus PQpipelineStatus(const PGconn *conn)
int lo_unlink(PGconn *conn, Oid lobjId)
int PQisnonblocking(const PGconn *conn)
void PQuntrace(PGconn *conn)
PGresult * PQcopyResult(const PGresult *src, int flags)
PGVerbosity PQsetErrorVerbosity(PGconn *conn, PGVerbosity verbosity)
PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn, PQnoticeProcessor proc, void *arg)
void * PQresultAlloc(PGresult *res, size_t nBytes)
Oid lo_import(PGconn *conn, const char *filename)
Oid PQoidValue(const PGresult *res)
int PQmblenBounded(const char *s, int encoding)
const char * PQsslAttribute(PGconn *conn, const char *attribute_name)
const char * pg_encoding_to_char(int encoding)
int lo_export(PGconn *conn, Oid lobjId, const char *filename)
char * PQresultVerboseErrorMessage(const PGresult *res, PGVerbosity verbosity, PGContextVisibility show_context)
int PQcancelStart(PGcancelConn *cancelConn)
int PQnfields(const PGresult *res)
Oid lo_import_with_oid(PGconn *conn, const char *filename, Oid lobjId)
void PQsetSSLKeyPassHook_OpenSSL(PQsslKeyPassHook_OpenSSL_type hook)
PGPing PQpingParams(const char *const *keywords, const char *const *values, int expand_dbname)
int PQsocket(const PGconn *conn)
char * PQoptions(const PGconn *conn)
PGresult * PQgetResult(PGconn *conn)
int PQfsize(const PGresult *res, int field_num)
int lo_truncate64(PGconn *conn, int fd, pg_int64 len)
int PQsetClientEncoding(PGconn *conn, const char *encoding)
struct pgresAttDesc PGresAttDesc
pgthreadlock_t PQregisterThreadLock(pgthreadlock_t newhandler)
int PQgetCopyData(PGconn *conn, char **buffer, int async)
static PgChecksumMode mode
static void do_init(void)
static const char * pghost
static const char * pgport
static const char * dbName
static int fd(const char *x, int i)
static pg_noinline void Size size