PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | pgNotify |
struct | _PQprintOpt |
struct | _PQconninfoOption |
struct | PQArgBlock |
struct | pgresAttDesc |
Macros | |
#define | LIBPQ_HAS_PIPELINING 1 |
#define | LIBPQ_HAS_TRACE_FLAGS 1 |
#define | LIBPQ_HAS_SSL_LIBRARY_DETECTION 1 |
#define | PG_COPYRES_ATTRS 0x01 |
#define | PG_COPYRES_TUPLES 0x02 /* Implies PG_COPYRES_ATTRS */ |
#define | PG_COPYRES_EVENTS 0x04 |
#define | PG_COPYRES_NOTICEHOOKS 0x08 |
#define | PQsetdb(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME) PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL) |
#define | PQTRACE_SUPPRESS_TIMESTAMPS (1<<0) |
#define | PQTRACE_REGRESS_MODE (1<<1) |
#define | PQ_QUERY_PARAM_MAX_LIMIT 65535 |
#define | PQfreeNotify(ptr) PQfreemem(ptr) |
#define | PQnoPasswordSupplied "fe_sendauth: no password supplied\n" |
Typedefs | |
typedef struct pg_conn | PGconn |
typedef struct pg_result | PGresult |
typedef struct pg_cancel | PGcancel |
typedef struct pgNotify | PGnotify |
typedef void(* | PQnoticeReceiver) (void *arg, const PGresult *res) |
typedef void(* | PQnoticeProcessor) (void *arg, const char *message) |
typedef char | pqbool |
typedef struct _PQprintOpt | PQprintOpt |
typedef struct _PQconninfoOption | PQconninfoOption |
typedef struct pgresAttDesc | PGresAttDesc |
typedef void(* | pgthreadlock_t) (int acquire) |
typedef int(* | PQsslKeyPassHook_OpenSSL_type) (char *buf, int size, PGconn *conn) |
Functions | |
PGconn * | PQconnectStart (const char *conninfo) |
PGconn * | PQconnectStartParams (const char *const *keywords, const char *const *values, int expand_dbname) |
PostgresPollingStatusType | PQconnectPoll (PGconn *conn) |
PGconn * | PQconnectdb (const char *conninfo) |
PGconn * | PQconnectdbParams (const char *const *keywords, const char *const *values, int expand_dbname) |
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) |
PQconninfoOption * | PQconndefaults (void) |
PQconninfoOption * | PQconninfoParse (const char *conninfo, char **errmsg) |
PQconninfoOption * | PQconninfo (PGconn *conn) |
void | PQconninfoFree (PQconninfoOption *connOptions) |
int | PQresetStart (PGconn *conn) |
PostgresPollingStatusType | PQresetPoll (PGconn *conn) |
void | PQreset (PGconn *conn) |
PGcancel * | PQgetCancel (PGconn *conn) |
void | PQfreeCancel (PGcancel *cancel) |
int | PQcancel (PGcancel *cancel, char *errbuf, int errbufsize) |
int | PQrequestCancel (PGconn *conn) |
char * | PQdb (const PGconn *conn) |
char * | PQuser (const PGconn *conn) |
char * | PQpass (const PGconn *conn) |
char * | PQhost (const PGconn *conn) |
char * | PQhostaddr (const PGconn *conn) |
char * | PQport (const PGconn *conn) |
char * | PQtty (const PGconn *conn) |
char * | PQoptions (const PGconn *conn) |
ConnStatusType | PQstatus (const PGconn *conn) |
PGTransactionStatusType | PQtransactionStatus (const PGconn *conn) |
const char * | PQparameterStatus (const PGconn *conn, const char *paramName) |
int | PQprotocolVersion (const PGconn *conn) |
int | PQserverVersion (const PGconn *conn) |
char * | PQerrorMessage (const PGconn *conn) |
int | PQsocket (const PGconn *conn) |
int | PQbackendPID (const PGconn *conn) |
PGpipelineStatus | PQpipelineStatus (const PGconn *conn) |
int | PQconnectionNeedsPassword (const PGconn *conn) |
int | PQconnectionUsedPassword (const PGconn *conn) |
int | PQconnectionUsedGSSAPI (const PGconn *conn) |
int | PQclientEncoding (const PGconn *conn) |
int | PQsetClientEncoding (PGconn *conn, const char *encoding) |
int | PQsslInUse (PGconn *conn) |
void * | PQsslStruct (PGconn *conn, const char *struct_name) |
const char * | PQsslAttribute (PGconn *conn, const char *attribute_name) |
const char *const * | PQsslAttributeNames (PGconn *conn) |
void * | PQgetssl (PGconn *conn) |
void | PQinitSSL (int do_init) |
void | PQinitOpenSSL (int do_ssl, int do_crypto) |
int | PQgssEncInUse (PGconn *conn) |
void * | PQgetgssctx (PGconn *conn) |
PGVerbosity | PQsetErrorVerbosity (PGconn *conn, PGVerbosity verbosity) |
PGContextVisibility | PQsetErrorContextVisibility (PGconn *conn, PGContextVisibility show_context) |
PQnoticeReceiver | PQsetNoticeReceiver (PGconn *conn, PQnoticeReceiver proc, void *arg) |
PQnoticeProcessor | PQsetNoticeProcessor (PGconn *conn, PQnoticeProcessor proc, void *arg) |
pgthreadlock_t | PQregisterThreadLock (pgthreadlock_t newhandler) |
void | PQtrace (PGconn *conn, FILE *debug_port) |
void | PQuntrace (PGconn *conn) |
void | PQsetTraceFlags (PGconn *conn, int flags) |
PGresult * | PQexec (PGconn *conn, const char *query) |
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 * | PQprepare (PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes) |
PGresult * | PQexecPrepared (PGconn *conn, const char *stmtName, int nParams, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat) |
int | PQsendQuery (PGconn *conn, const char *query) |
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 | PQsendPrepare (PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes) |
int | PQsendQueryPrepared (PGconn *conn, const char *stmtName, int nParams, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat) |
int | PQsetSingleRowMode (PGconn *conn) |
PGresult * | PQgetResult (PGconn *conn) |
int | PQisBusy (PGconn *conn) |
int | PQconsumeInput (PGconn *conn) |
int | PQenterPipelineMode (PGconn *conn) |
int | PQexitPipelineMode (PGconn *conn) |
int | PQpipelineSync (PGconn *conn) |
int | PQsendFlushRequest (PGconn *conn) |
PGnotify * | PQnotifies (PGconn *conn) |
int | PQputCopyData (PGconn *conn, const char *buffer, int nbytes) |
int | PQputCopyEnd (PGconn *conn, const char *errormsg) |
int | PQgetCopyData (PGconn *conn, char **buffer, int async) |
int | PQgetline (PGconn *conn, char *buffer, int length) |
int | PQputline (PGconn *conn, const char *string) |
int | PQgetlineAsync (PGconn *conn, char *buffer, int bufsize) |
int | PQputnbytes (PGconn *conn, const char *buffer, int nbytes) |
int | PQendcopy (PGconn *conn) |
int | PQsetnonblocking (PGconn *conn, int arg) |
int | PQisnonblocking (const PGconn *conn) |
int | PQisthreadsafe (void) |
PGPing | PQping (const char *conninfo) |
PGPing | PQpingParams (const char *const *keywords, const char *const *values, int expand_dbname) |
int | PQflush (PGconn *conn) |
PGresult * | PQfn (PGconn *conn, int fnid, int *result_buf, int *result_len, int result_is_int, const PQArgBlock *args, int nargs) |
ExecStatusType | PQresultStatus (const PGresult *res) |
char * | PQresStatus (ExecStatusType status) |
char * | PQresultErrorMessage (const PGresult *res) |
char * | PQresultVerboseErrorMessage (const PGresult *res, PGVerbosity verbosity, PGContextVisibility show_context) |
char * | PQresultErrorField (const PGresult *res, int fieldcode) |
int | PQntuples (const PGresult *res) |
int | PQnfields (const PGresult *res) |
int | PQbinaryTuples (const PGresult *res) |
char * | PQfname (const PGresult *res, int field_num) |
int | PQfnumber (const PGresult *res, const char *field_name) |
Oid | PQftable (const PGresult *res, int field_num) |
int | PQftablecol (const PGresult *res, int field_num) |
int | PQfformat (const PGresult *res, int field_num) |
Oid | PQftype (const PGresult *res, int field_num) |
int | PQfsize (const PGresult *res, int field_num) |
int | PQfmod (const PGresult *res, int field_num) |
char * | PQcmdStatus (PGresult *res) |
char * | PQoidStatus (const PGresult *res) |
Oid | PQoidValue (const PGresult *res) |
char * | PQcmdTuples (PGresult *res) |
char * | PQgetvalue (const PGresult *res, int tup_num, int field_num) |
int | PQgetlength (const PGresult *res, int tup_num, int field_num) |
int | PQgetisnull (const PGresult *res, int tup_num, int field_num) |
int | PQnparams (const PGresult *res) |
Oid | PQparamtype (const PGresult *res, int param_num) |
PGresult * | PQdescribePrepared (PGconn *conn, const char *stmt) |
PGresult * | PQdescribePortal (PGconn *conn, const char *portal) |
int | PQsendDescribePrepared (PGconn *conn, const char *stmt) |
int | PQsendDescribePortal (PGconn *conn, const char *portal) |
PGresult * | PQclosePrepared (PGconn *conn, const char *stmt) |
PGresult * | PQclosePortal (PGconn *conn, const char *portal) |
int | PQsendClosePrepared (PGconn *conn, const char *stmt) |
int | PQsendClosePortal (PGconn *conn, const char *portal) |
void | PQclear (PGresult *res) |
void | PQfreemem (void *ptr) |
PGresult * | PQmakeEmptyPGresult (PGconn *conn, ExecStatusType status) |
PGresult * | PQcopyResult (const PGresult *src, int flags) |
int | PQsetResultAttrs (PGresult *res, int numAttributes, PGresAttDesc *attDescs) |
void * | PQresultAlloc (PGresult *res, size_t nBytes) |
size_t | PQresultMemorySize (const PGresult *res) |
int | PQsetvalue (PGresult *res, int tup_num, int field_num, char *value, int len) |
size_t | PQescapeStringConn (PGconn *conn, char *to, const char *from, size_t length, int *error) |
char * | PQescapeLiteral (PGconn *conn, const char *str, size_t len) |
char * | PQescapeIdentifier (PGconn *conn, const char *str, size_t len) |
unsigned char * | PQescapeByteaConn (PGconn *conn, const unsigned char *from, size_t from_length, size_t *to_length) |
unsigned char * | PQunescapeBytea (const unsigned char *strtext, size_t *retbuflen) |
size_t | PQescapeString (char *to, const char *from, size_t length) |
unsigned char * | PQescapeBytea (const unsigned char *from, size_t from_length, size_t *to_length) |
void | PQprint (FILE *fout, const PGresult *res, const PQprintOpt *po) |
void | PQdisplayTuples (const PGresult *res, FILE *fp, int fillAlign, const char *fieldSep, int printHeader, int quiet) |
void | PQprintTuples (const PGresult *res, FILE *fout, int PrintAttNames, int TerseOutput, int colWidth) |
int | lo_open (PGconn *conn, Oid lobjId, int mode) |
int | lo_close (PGconn *conn, int fd) |
int | lo_read (PGconn *conn, int fd, char *buf, size_t len) |
int | lo_write (PGconn *conn, int fd, const char *buf, size_t len) |
int | lo_lseek (PGconn *conn, int fd, int offset, int whence) |
pg_int64 | lo_lseek64 (PGconn *conn, int fd, pg_int64 offset, int whence) |
Oid | lo_creat (PGconn *conn, int mode) |
Oid | lo_create (PGconn *conn, Oid lobjId) |
int | lo_tell (PGconn *conn, int fd) |
pg_int64 | lo_tell64 (PGconn *conn, int fd) |
int | lo_truncate (PGconn *conn, int fd, size_t len) |
int | lo_truncate64 (PGconn *conn, int fd, pg_int64 len) |
int | lo_unlink (PGconn *conn, Oid lobjId) |
Oid | lo_import (PGconn *conn, const char *filename) |
Oid | lo_import_with_oid (PGconn *conn, const char *filename, Oid lobjId) |
int | lo_export (PGconn *conn, Oid lobjId, const char *filename) |
int | PQlibVersion (void) |
int | PQmblen (const char *s, int encoding) |
int | PQmblenBounded (const char *s, int encoding) |
int | PQdsplen (const char *s, int encoding) |
int | PQenv2encoding (void) |
char * | PQencryptPassword (const char *passwd, const char *user) |
char * | PQencryptPasswordConn (PGconn *conn, const char *passwd, const char *user, const char *algorithm) |
int | pg_char_to_encoding (const char *name) |
const char * | pg_encoding_to_char (int encoding) |
int | pg_valid_server_encoding_id (int encoding) |
PQsslKeyPassHook_OpenSSL_type | PQgetSSLKeyPassHook_OpenSSL (void) |
void | PQsetSSLKeyPassHook_OpenSSL (PQsslKeyPassHook_OpenSSL_type hook) |
int | PQdefaultSSLKeyPassHook_OpenSSL (char *buf, int size, PGconn *conn) |
#define LIBPQ_HAS_PIPELINING 1 |
Definition at line 36 of file libpq-fe.h.
#define LIBPQ_HAS_SSL_LIBRARY_DETECTION 1 |
Definition at line 40 of file libpq-fe.h.
#define LIBPQ_HAS_TRACE_FLAGS 1 |
Definition at line 38 of file libpq-fe.h.
#define PG_COPYRES_ATTRS 0x01 |
Definition at line 45 of file libpq-fe.h.
#define PG_COPYRES_EVENTS 0x04 |
Definition at line 47 of file libpq-fe.h.
#define PG_COPYRES_NOTICEHOOKS 0x08 |
Definition at line 48 of file libpq-fe.h.
#define PG_COPYRES_TUPLES 0x02 /* Implies PG_COPYRES_ATTRS */ |
Definition at line 46 of file libpq-fe.h.
#define PQ_QUERY_PARAM_MAX_LIMIT 65535 |
Definition at line 444 of file libpq-fe.h.
#define PQfreeNotify | ( | ptr | ) | PQfreemem(ptr) |
Definition at line 564 of file libpq-fe.h.
#define PQnoPasswordSupplied "fe_sendauth: no password supplied\n" |
Definition at line 568 of file libpq-fe.h.
#define PQsetdb | ( | M_PGHOST, | |
M_PGPORT, | |||
M_PGOPT, | |||
M_PGTTY, | |||
M_DBNAME | |||
) | PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL) |
Definition at line 295 of file libpq-fe.h.
#define PQTRACE_REGRESS_MODE (1<<1) |
Definition at line 417 of file libpq-fe.h.
#define PQTRACE_SUPPRESS_TIMESTAMPS (1<<0) |
Definition at line 415 of file libpq-fe.h.
Definition at line 1 of file libpq-fe.h.
Definition at line 1 of file libpq-fe.h.
typedef struct pgresAttDesc PGresAttDesc |
Definition at line 1 of file libpq-fe.h.
typedef void(* pgthreadlock_t) (int acquire) |
Definition at line 405 of file libpq-fe.h.
typedef char pqbool |
Definition at line 201 of file libpq-fe.h.
typedef struct _PQconninfoOption PQconninfoOption |
typedef void(* PQnoticeProcessor) (void *arg, const char *message) |
Definition at line 198 of file libpq-fe.h.
Definition at line 197 of file libpq-fe.h.
typedef struct _PQprintOpt PQprintOpt |
Definition at line 672 of file libpq-fe.h.
enum ConnStatusType |
Definition at line 58 of file libpq-fe.h.
enum ExecStatusType |
Definition at line 94 of file libpq-fe.h.
enum PGContextVisibility |
Enumerator | |
---|---|
PQSHOW_CONTEXT_NEVER | |
PQSHOW_CONTEXT_ERRORS | |
PQSHOW_CONTEXT_ALWAYS |
Definition at line 133 of file libpq-fe.h.
enum PGPing |
Enumerator | |
---|---|
PQPING_OK | |
PQPING_REJECT | |
PQPING_NO_RESPONSE | |
PQPING_NO_ATTEMPT |
Definition at line 145 of file libpq-fe.h.
enum PGpipelineStatus |
Enumerator | |
---|---|
PQ_PIPELINE_OFF | |
PQ_PIPELINE_ON | |
PQ_PIPELINE_ABORTED |
Definition at line 156 of file libpq-fe.h.
Enumerator | |
---|---|
PQTRANS_IDLE | |
PQTRANS_ACTIVE | |
PQTRANS_INTRANS | |
PQTRANS_INERROR | |
PQTRANS_UNKNOWN |
Definition at line 116 of file libpq-fe.h.
enum PGVerbosity |
Enumerator | |
---|---|
PQERRORS_TERSE | |
PQERRORS_DEFAULT | |
PQERRORS_VERBOSE | |
PQERRORS_SQLSTATE |
Definition at line 125 of file libpq-fe.h.
Enumerator | |
---|---|
PGRES_POLLING_FAILED | |
PGRES_POLLING_READING | |
PGRES_POLLING_WRITING | |
PGRES_POLLING_OK | |
PGRES_POLLING_ACTIVE |
Definition at line 84 of file libpq-fe.h.
int lo_close | ( | PGconn * | conn, |
int | fd | ||
) |
Definition at line 96 of file fe-lobj.c.
References conn, fd(), pgLobjfuncs::fn_lo_close, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, lo_initialize(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), res, and PQArgBlock::u.
Referenced by dumpLOs(), EndRestoreLO(), exportFile(), importFile(), lo_export(), lo_import_internal(), my_truncate(), overwrite(), and pickout().
Definition at line 438 of file fe-lobj.c.
References conn, pgLobjfuncs::fn_lo_creat, PQArgBlock::integer, InvalidOid, PQArgBlock::isint, PQArgBlock::len, lo_initialize(), pg_conn::lobjfuncs, mode, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), res, and PQArgBlock::u.
Referenced by importFile(), and lo_import_internal().
Definition at line 474 of file fe-lobj.c.
References conn, pgLobjfuncs::fn_lo_create, PQArgBlock::integer, InvalidOid, PQArgBlock::isint, PQArgBlock::len, libpq_append_conn_error(), lo_initialize(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), res, and PQArgBlock::u.
Referenced by lo_import_internal(), and StartRestoreLO().
Definition at line 748 of file fe-lobj.c.
References buf, close, conn, fd(), filename, INV_READ, libpq_append_conn_error(), LO_BUFSIZE, lo_close(), lo_open(), lo_read(), PG_BINARY, PG_STRERROR_R_BUFLEN, pqClearConnErrorState, strerror_r, and write.
Referenced by do_lo_export(), and main().
Definition at line 626 of file fe-lobj.c.
References conn, filename, InvalidOid, and lo_import_internal().
Referenced by do_lo_import(), and main().
Definition at line 641 of file fe-lobj.c.
References conn, filename, and lo_import_internal().
int lo_lseek | ( | PGconn * | conn, |
int | fd, | ||
int | offset, | ||
int | whence | ||
) |
Definition at line 344 of file fe-lobj.c.
References conn, fd(), pgLobjfuncs::fn_lo_lseek, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, lo_initialize(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), res, and PQArgBlock::u.
Referenced by overwrite(), and pickout().
Definition at line 385 of file fe-lobj.c.
References conn, fd(), pgLobjfuncs::fn_lo_lseek64, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, libpq_append_conn_error(), lo_hton64(), lo_initialize(), lo_ntoh64(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), PQArgBlock::ptr, res, and PQArgBlock::u.
Referenced by overwrite(), and pickout().
Definition at line 57 of file fe-lobj.c.
References conn, fd(), pgLobjfuncs::fn_lo_open, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, lo_initialize(), pg_conn::lobjfuncs, mode, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), res, and PQArgBlock::u.
Referenced by dumpLOs(), exportFile(), importFile(), lo_export(), lo_import_internal(), my_truncate(), overwrite(), pickout(), and StartRestoreLO().
int lo_read | ( | PGconn * | conn, |
int | fd, | ||
char * | buf, | ||
size_t | len | ||
) |
Definition at line 245 of file fe-lobj.c.
References buf, conn, fd(), pgLobjfuncs::fn_lo_read, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, len, libpq_append_conn_error(), lo_initialize(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), res, and PQArgBlock::u.
Referenced by lo_export().
int lo_tell | ( | PGconn * | conn, |
int | fd | ||
) |
Definition at line 515 of file fe-lobj.c.
References conn, fd(), pgLobjfuncs::fn_lo_tell, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, lo_initialize(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), res, and PQArgBlock::u.
Definition at line 548 of file fe-lobj.c.
References conn, fd(), pgLobjfuncs::fn_lo_tell64, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, libpq_append_conn_error(), lo_initialize(), lo_ntoh64(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), res, and PQArgBlock::u.
Referenced by pickout().
int lo_truncate | ( | PGconn * | conn, |
int | fd, | ||
size_t | len | ||
) |
Definition at line 131 of file fe-lobj.c.
References conn, fd(), pgLobjfuncs::fn_lo_truncate, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, len, libpq_append_conn_error(), lo_initialize(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), res, and PQArgBlock::u.
Definition at line 195 of file fe-lobj.c.
References conn, fd(), pgLobjfuncs::fn_lo_truncate64, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, len, libpq_append_conn_error(), lo_hton64(), lo_initialize(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), PQArgBlock::ptr, res, and PQArgBlock::u.
Referenced by my_truncate().
Definition at line 589 of file fe-lobj.c.
References conn, pgLobjfuncs::fn_lo_unlink, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, lo_initialize(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), res, and PQArgBlock::u.
Referenced by do_lo_unlink(), and vacuumlo().
int lo_write | ( | PGconn * | conn, |
int | fd, | ||
const char * | buf, | ||
size_t | len | ||
) |
Definition at line 295 of file fe-lobj.c.
References buf, conn, fd(), pgLobjfuncs::fn_lo_write, PQArgBlock::integer, PQArgBlock::isint, PQArgBlock::len, len, libpq_append_conn_error(), lo_initialize(), pg_conn::lobjfuncs, PGRES_COMMAND_OK, PQclear(), PQfn(), PQresultStatus(), PQArgBlock::ptr, res, PQArgBlock::u, and unconstify.
Referenced by lo_import_internal().
int pg_char_to_encoding | ( | const char * | name | ) |
Definition at line 550 of file encnames.c.
References clean_encoding_name(), sort-test::key, lengthof, name, NAMEDATALEN, and pg_encname_tbl.
Referenced by CreateConversionCommand(), length_in_encoding(), main(), PG_char_to_encoding(), pg_convert(), pg_get_utf8_id(), pg_valid_client_encoding(), pg_valid_server_encoding(), PQenv2encoding(), pqSaveParameterStatus(), ProcessCopyOptions(), processEncodingEntry(), test_enc_conversion(), and to_ascii_encname().
const char* pg_encoding_to_char | ( | int | encoding | ) |
Definition at line 588 of file encnames.c.
References Assert(), encoding, pg_enc2name::encoding, pg_enc2name::name, pg_enc2name_tbl, and PG_VALID_ENCODING.
Referenced by _doSetFixedOutputState(), BeginCopyFrom(), check_client_encoding(), check_encoding_locale_matches(), check_icu_locale_encoding(), check_locale_encoding(), CollationCreate(), connectOptions2(), ConversionCreate(), createdb(), dumpEncoding(), exec_command_encoding(), main(), pg_do_encoding_conversion(), PG_encoding_to_char(), pg_to_ascii(), PQsetClientEncoding(), SendQuery(), setup_locale_encoding(), setupDumpWorker(), SyncVariables(), and test_enc_conversion().
int pg_valid_server_encoding_id | ( | int | encoding | ) |
Definition at line 514 of file encnames.c.
References encoding, and PG_VALID_BE_ENCODING.
Referenced by setup_locale_encoding().
int PQbackendPID | ( | const PGconn * | conn | ) |
Definition at line 7282 of file fe-connect.c.
References pg_conn::be_pid, conn, CONNECTION_OK, and pg_conn::status.
Referenced by get_prompt(), libpqrcv_get_backend_pid(), main(), and StartLogStreamer().
int PQbinaryTuples | ( | const PGresult * | res | ) |
Definition at line 3411 of file fe-exec.c.
References pg_result::binary, and res.
Referenced by HandleCopyResult().
int PQcancel | ( | PGcancel * | cancel, |
char * | errbuf, | ||
int | errbufsize | ||
) |
Definition at line 4821 of file fe-connect.c.
References SockAddr::addr, pg_cancel::be_key, pg_cancel::be_pid, buf, CANCEL_REQUEST_CODE, closesocket, connect, EINTR, pg_cancel::keepalives, pg_cancel::keepalives_count, pg_cancel::keepalives_idle, pg_cancel::keepalives_interval, optional_setsockopt(), pg_hton32, PGINVALID_SOCKET, pg_cancel::pgtcp_user_timeout, pg_cancel::raddr, recv, SockAddr::salen, send, SOCK_ERRNO, SOCK_ERRNO_SET, socket, strlcpy(), and val.
Referenced by dblink_cancel_query(), DisconnectDatabase(), disconnectDatabase(), handle_sigint(), pgfdw_cancel_query_begin(), PQrequestCancel(), ShutdownWorkersHard(), sigTermHandler(), and try_complete_step().
void PQclear | ( | PGresult * | res | ) |
Definition at line 718 of file fe-exec.c.
References pg_result::attDescs, pg_result::curBlock, pg_result::errFields, pg_result::events, free, i, PGEvent::name, pg_result::nEvents, pgresult_data::next, OOM_result, pg_result::paramDescs, PGEvent::passThrough, PGEVT_RESULTDESTROY, PGEvent::proc, res, PGEventResultDestroy::result, PGEvent::resultInitialized, and pg_result::tuples.
Referenced by pqClearAsyncResult(), PQcopyResult(), PQexecFinish(), PQexecStart(), pqInternalNotice(), PQmakeEmptyPGresult(), and pqRowProcessor().
int PQclientEncoding | ( | const PGconn * | conn | ) |
Definition at line 7336 of file fe-connect.c.
References pg_conn::client_encoding, conn, CONNECTION_OK, and pg_conn::status.
Referenced by appendQualifiedRelation(), appendStringLiteralConn(), dblink_connect(), dblink_get_conn(), exec_command_encoding(), main(), processSQLNamePattern(), SendQuery(), setup_connection(), SyncVariables(), and vacuum_one_database().
Definition at line 2505 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), PqMsg_Close, and PQsendTypedCommand().
Referenced by test_prepared().
Definition at line 2487 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), PqMsg_Close, PQsendTypedCommand(), and stmt.
Referenced by test_prepared().
char* PQcmdStatus | ( | PGresult * | res | ) |
Definition at line 3666 of file fe-exec.c.
References pg_result::cmdStatus, and res.
Referenced by dblink_exec(), ecpg_process_output(), ExecQueryAndProcessResults(), materializeResult(), PrintQueryResult(), PrintQueryStatus(), and test_pipelined_insert().
char* PQcmdTuples | ( | PGresult * | res | ) |
Definition at line 3736 of file fe-exec.c.
References pg_result::cmdStatus, pg_result::noticeHooks, pqInternalNotice(), and res.
Referenced by ecpg_process_output(), execute_dml_stmt(), execute_foreign_modify(), and SetResultVariables().
PQconninfoOption* PQconndefaults | ( | void | ) |
Definition at line 1778 of file fe-connect.c.
References conninfo_add_defaults(), conninfo_init(), initPQExpBuffer(), PQconninfoFree(), PQExpBufferDataBroken, and termPQExpBuffer().
Referenced by check_pghost_envvar(), dblink_fdw_validator(), do_connect(), get_connect_string(), InitPgFdwOptions(), and main().
PGconn* PQconnectdb | ( | const char * | conninfo | ) |
Definition at line 731 of file fe-connect.c.
References conn, connectDBComplete(), CONNECTION_BAD, PQconnectStart(), and pg_conn::status.
Referenced by get_db_conn(), and main().
PGconn* PQconnectdbParams | ( | const char *const * | keywords, |
const char *const * | values, | ||
int | expand_dbname | ||
) |
Definition at line 676 of file fe-connect.c.
References conn, connectDBComplete(), CONNECTION_BAD, PQconnectStartParams(), pg_conn::status, and values.
Referenced by ConnectDatabase(), connectDatabase(), do_connect(), doConnect(), ECPGconnect(), GetConnection(), main(), sql_conn(), and vacuumlo().
int PQconnectionNeedsPassword | ( | const PGconn * | conn | ) |
Definition at line 7299 of file fe-connect.c.
References conn, password, pg_conn::password_needed, and PQpass().
Referenced by ConnectDatabase(), connectDatabase(), do_connect(), doConnect(), GetConnection(), main(), sql_conn(), and vacuumlo().
int PQconnectionUsedGSSAPI | ( | const PGconn * | conn | ) |
Definition at line 7325 of file fe-connect.c.
References conn, and pg_conn::gssapi_used.
Referenced by dblink_security_check(), and pgfdw_security_check().
int PQconnectionUsedPassword | ( | const PGconn * | conn | ) |
Definition at line 7314 of file fe-connect.c.
References conn, and pg_conn::password_needed.
Referenced by ConnectDatabase(), dblink_security_check(), libpqrcv_connect(), and pgfdw_security_check().
PostgresPollingStatusType PQconnectPoll | ( | PGconn * | conn | ) |
Definition at line 2541 of file fe-connect.c.
References AddrInfo::addr, SockAddr::addr, pg_conn::addr, appendPQExpBufferChar(), pg_conn::appname, Assert(), pg_conn::asyncStatus, AUTH_REQ_OK, pg_conn::auth_req_received, CHT_HOST_ADDRESS, CHT_HOST_NAME, CHT_UNIX_SOCKET, conn, connect, connectFailureMessage(), CONNECTION_AUTH_OK, CONNECTION_AWAITING_RESPONSE, CONNECTION_BAD, CONNECTION_CHECK_STANDBY, CONNECTION_CHECK_TARGET, CONNECTION_CHECK_WRITABLE, CONNECTION_CONSUME, CONNECTION_GSS_STARTUP, CONNECTION_MADE, CONNECTION_NEEDED, CONNECTION_OK, CONNECTION_SSL_STARTUP, CONNECTION_STARTED, connectNoDelay(), pg_conn::connhost, pg_conn::connip, PQExpBufferData::data, pg_conn::default_transaction_read_only, EINPROGRESS, EINTR, emitHostIdentityInfo(), EnvironmentOptions, err(), ERRCODE_APPNAME_UNKNOWN, ERRCODE_CANNOT_CONNECT_NOW, pg_conn::errorMessage, EWOULDBLOCK, AddrInfo::family, pg_conn::fbappname, free, getHostaddr(), getpeereid(), pg_conn::gssencmode, pg_conn_host::host, pg_conn_host::hostaddr, i, pg_conn::in_hot_standby, pg_conn::inCursor, pg_conn::inEnd, pg_conn::inStart, j, pg_conn::laddr, pg_conn::last_sqlstate, PQExpBufferData::len, libpq_append_conn_error(), LOAD_BALANCE_RANDOM, pg_conn::load_balance_type, MAX_ERRLEN, MAXPGPATH, MemSet, pg_conn::naddr, pg_conn::nconnhost, NEGOTIATE_GSS_CODE, NEGOTIATE_SSL_CODE, parse_int_param(), PG_BOOL_NO, PG_BOOL_UNKNOWN, PG_BOOL_YES, PG_DIAG_SQLSTATE, pg_fe_getusername(), pg_fe_sendauth(), pg_freeaddrinfo_all(), pg_getaddrinfo_all(), pg_GSS_have_cred_cache(), pg_hton32, pg_prng_uint64_range(), PG_PROTOCOL, pg_set_noblock(), PG_STRERROR_R_BUFLEN, PGASYNC_BUSY, PGASYNC_IDLE, PGINVALID_SOCKET, pgpassfileWarning(), PGRES_FATAL_ERROR, PGRES_POLLING_FAILED, PGRES_POLLING_OK, PGRES_POLLING_READING, PGRES_POLLING_WRITING, PGRES_TUPLES_OK, pg_conn::pipelineStatus, pg_conn_host::port, PQ_PIPELINE_OFF, pqBuildStartupPacket3(), pqCheckInBufferSpace(), PQclear(), pqClearAsyncResult(), pqClearConnErrorState, PQconsumeInput(), pqDropConnection(), pqDropServerData(), pqFlush(), pqGetc(), pqGetErrorNotice3(), pqGetInt(), pqGetNegotiateProtocolVersion3(), PQgetResult(), pqGets_append(), PQgetvalue(), PQisBusy(), PqMsg_AuthenticationRequest, PqMsg_ErrorResponse, PqMsg_NegotiateProtocolVersion, PQntuples(), pqPacketSend(), pqReadData(), PQresultErrorField(), PQresultStatus(), pqsecure_initialize(), pqsecure_open_client(), pqsecure_open_gss(), PQsendQueryContinue(), PQTRANS_IDLE, pg_conn::prng_state, pg_conn::pversion, pg_conn::raddr, release_conn_addrinfo(), pg_conn::requirepeer, res, pg_result::resultStatus, SockAddr::salen, pg_conn::send_appname, sendTerminateConn(), SERVER_TYPE_PREFER_STANDBY, SERVER_TYPE_PREFER_STANDBY_PASS2, SERVER_TYPE_PRIMARY, SERVER_TYPE_READ_ONLY, SERVER_TYPE_READ_WRITE, SERVER_TYPE_STANDBY, setKeepalivesCount(), setKeepalivesIdle(), setKeepalivesInterval(), setTCPUserTimeout(), pg_conn::sigpipe_flag, pg_conn::sigpipe_so, snprintf, pg_conn::sock, SOCK_ERRNO, SOCK_STRERROR, socket, pg_conn::ssl_in_use, pg_conn::sslmode, pg_conn::status, STATUS_OK, store_conn_addrinfo(), strerror_r, pg_conn::sversion, pg_conn::target_server_type, pg_conn::try_next_addr, pg_conn::try_next_host, pg_conn_host::type, UNIXSOCK_PATH, UNIXSOCK_PATH_BUFLEN, useKeepalives(), val, pg_conn::whichaddr, pg_conn::whichhost, and pg_conn::xactStatus.
Referenced by connectDBComplete(), connectDBStart(), libpqsrv_connect_internal(), and PQresetPoll().
PGconn* PQconnectStart | ( | const char * | conninfo | ) |
Definition at line 859 of file fe-connect.c.
References conn, connectDBStart(), CONNECTION_BAD, connectOptions1(), connectOptions2(), makeEmptyPGconn(), and pg_conn::status.
Referenced by libpqsrv_connect(), PQconnectdb(), and PQping().
PGconn* PQconnectStartParams | ( | const char *const * | keywords, |
const char *const * | values, | ||
int | expand_dbname | ||
) |
Definition at line 778 of file fe-connect.c.
References conn, connectDBStart(), CONNECTION_BAD, connectOptions2(), conninfo_array_parse(), pg_conn::errorMessage, fillPGconn(), makeEmptyPGconn(), PQconninfoFree(), pg_conn::status, and values.
Referenced by libpqsrv_connect_params(), PQconnectdbParams(), and PQpingParams().
PQconninfoOption* PQconninfo | ( | PGconn * | conn | ) |
Definition at line 7037 of file fe-connect.c.
References conn, conninfo_init(), conninfo_storeval(), initPQExpBuffer(), PQconninfoOptions, PQExpBufferDataBroken, and termPQExpBuffer().
Referenced by do_connect(), GenerateRecoveryConfig(), and libpqrcv_get_conninfo().
void PQconninfoFree | ( | PQconninfoOption * | connOptions | ) |
Definition at line 7081 of file fe-connect.c.
References free, and option::val.
Referenced by check_pghost_envvar(), connectDatabase(), connectOptions1(), conninfo_array_parse(), conninfo_parse(), conninfo_uri_parse(), dblink_connstr_has_pw(), do_connect(), GenerateRecoveryConfig(), GetConnection(), libpqrcv_check_conninfo(), libpqrcv_get_conninfo(), PQconndefaults(), and PQconnectStartParams().
PQconninfoOption* PQconninfoParse | ( | const char * | conninfo, |
char ** | errmsg | ||
) |
Definition at line 5829 of file fe-connect.c.
References PQExpBufferData::data, errmsg(), initPQExpBuffer(), parse_connection_string(), PQExpBufferDataBroken, and termPQExpBuffer().
Referenced by connectDatabase(), dblink_connstr_has_pw(), do_connect(), GetConnection(), libpqrcv_check_conninfo(), and main().
int PQconsumeInput | ( | PGconn * | conn | ) |
Definition at line 1957 of file fe-exec.c.
References conn, pqFlush(), pqIsnonblocking, and pqReadData().
Referenced by advanceConnectionState(), CopyStreamReceive(), dblink_get_notify(), dblink_is_busy(), do_sql_command_end(), ecpg_process_output(), libpqrcv_PQgetResult(), libpqrcv_receive(), main(), pgfdw_cancel_query_end(), pgfdw_exec_cleanup_query_end(), pgfdw_get_cleanup_result(), pgfdw_get_result(), postgresForeignAsyncNotify(), PQconnectPoll(), PrintNotifications(), StreamLogicalLog(), test_nosync(), test_pipelined_insert(), test_uniqviol(), try_complete_step(), and wait_on_slots().
Definition at line 315 of file fe-exec.c.
References pg_result::attDescs, pg_result::client_encoding, pg_result::cmdStatus, generate_unaccent_rules::dest, PGEventResultCopy::dest, dupEvents(), pg_result::events, i, pgresAttValue::len, pg_result::nEvents, pg_result::noticeHooks, pg_result::ntups, pg_result::numAttributes, PG_COPYRES_ATTRS, PG_COPYRES_EVENTS, PG_COPYRES_NOTICEHOOKS, PG_COPYRES_TUPLES, PGEVT_RESULTCOPY, PGRES_TUPLES_OK, PQclear(), PQmakeEmptyPGresult(), PQsetResultAttrs(), PQsetvalue(), PGEvent::resultInitialized, PGEventResultCopy::src, pg_result::tuples, and pgresAttValue::value.
Referenced by pqRowProcessor().
char* PQdb | ( | const PGconn * | conn | ) |
Definition at line 7094 of file fe-connect.c.
References conn, and pg_conn::dbName.
Referenced by append_rel_pattern_filtered_cte(), cluster_one_database(), do_connect(), exec_command_conninfo(), find_matching_idle_slot(), get_prompt(), GetTableInfo(), main(), prohibit_crossdb_refs(), reindex_one_database(), run_command(), run_reindex_command(), run_vacuum_command(), slashUsage(), SyncVariables(), TableCommandResultHandler(), vacuum_one_database(), validateSQLNamePattern(), and WriteHead().
int PQdefaultSSLKeyPassHook_OpenSSL | ( | char * | buf, |
int | size, | ||
PGconn * | conn | ||
) |
Definition at line 1966 of file fe-secure-openssl.c.
References buf, conn, fprintf, libpq_gettext, and pg_conn::sslpassword.
Referenced by PQssl_passwd_cb().
Definition at line 2440 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), PqMsg_Describe, and PQsendTypedCommand().
Referenced by test_prepared().
Definition at line 2421 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), PqMsg_Describe, PQsendTypedCommand(), and stmt.
Referenced by DescribeQuery(), ECPGdescribe(), and test_prepared().
void PQdisplayTuples | ( | const PGresult * | res, |
FILE * | fp, | ||
int | fillAlign, | ||
const char * | fieldSep, | ||
int | printHeader, | ||
int | quiet | ||
) |
Definition at line 574 of file fe-print.c.
References DEFAULT_FIELD_SEP, fflush(), fill(), fprintf, free, i, j, libpq_gettext, malloc, PQfname(), PQgetlength(), PQgetvalue(), PQnfields(), PQntuples(), res, and generate_unaccent_rules::stdout.
int PQdsplen | ( | const char * | s, |
int | encoding | ||
) |
Definition at line 1197 of file fe-misc.c.
References encoding, and pg_encoding_dsplen().
Referenced by get_prompt(), pg_wcsformat(), pg_wcssize(), pg_wcswidth(), and strlen_max_width().
char* PQencryptPassword | ( | const char * | passwd, |
const char * | user | ||
) |
Definition at line 1234 of file fe-auth.c.
References free, malloc, MD5_PASSWD_LEN, pg_md5_encrypt(), and user.