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 | LIBPQ_HAS_ASYNC_CANCEL 1 |
#define | LIBPQ_HAS_CHANGE_PASSWORD 1 |
#define | LIBPQ_HAS_CHUNK_MODE 1 |
#define | LIBPQ_HAS_CLOSE_PREPARED 1 |
#define | LIBPQ_HAS_SEND_PIPELINE_SYNC 1 |
#define | LIBPQ_HAS_SOCKET_POLL 1 |
#define | LIBPQ_HAS_FULL_PROTOCOL_VERSION 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_cancel_conn | PGcancelConn |
typedef struct pg_result | PGresult |
typedef struct pg_cancel | PGcancel |
typedef struct pgNotify | PGnotify |
typedef pg_int64 | pg_usec_time_t |
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) |
PGcancelConn * | PQcancelCreate (PGconn *conn) |
int | PQcancelStart (PGcancelConn *cancelConn) |
int | PQcancelBlocking (PGcancelConn *cancelConn) |
PostgresPollingStatusType | PQcancelPoll (PGcancelConn *cancelConn) |
ConnStatusType | PQcancelStatus (const PGcancelConn *cancelConn) |
int | PQcancelSocket (const PGcancelConn *cancelConn) |
char * | PQcancelErrorMessage (const PGcancelConn *cancelConn) |
void | PQcancelReset (PGcancelConn *cancelConn) |
void | PQcancelFinish (PGcancelConn *cancelConn) |
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 | PQfullProtocolVersion (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) |
int | PQsetChunkedRowsMode (PGconn *conn, int chunkSize) |
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) |
int | PQsendPipelineSync (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 | PQsocketPoll (int sock, int forRead, int forWrite, pg_usec_time_t end_time) |
pg_usec_time_t | PQgetCurrentTimeUSec (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) |
PGresult * | PQchangePassword (PGconn *conn, const char *user, const char *passwd) |
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_ASYNC_CANCEL 1 |
Definition at line 47 of file libpq-fe.h.
#define LIBPQ_HAS_CHANGE_PASSWORD 1 |
Definition at line 49 of file libpq-fe.h.
#define LIBPQ_HAS_CHUNK_MODE 1 |
Definition at line 51 of file libpq-fe.h.
#define LIBPQ_HAS_CLOSE_PREPARED 1 |
Definition at line 53 of file libpq-fe.h.
#define LIBPQ_HAS_FULL_PROTOCOL_VERSION 1 |
Definition at line 61 of file libpq-fe.h.
#define LIBPQ_HAS_PIPELINING 1 |
Definition at line 37 of file libpq-fe.h.
#define LIBPQ_HAS_SEND_PIPELINE_SYNC 1 |
Definition at line 55 of file libpq-fe.h.
#define LIBPQ_HAS_SOCKET_POLL 1 |
Definition at line 57 of file libpq-fe.h.
#define LIBPQ_HAS_SSL_LIBRARY_DETECTION 1 |
Definition at line 43 of file libpq-fe.h.
#define LIBPQ_HAS_TRACE_FLAGS 1 |
Definition at line 39 of file libpq-fe.h.
#define PG_COPYRES_ATTRS 0x01 |
Definition at line 66 of file libpq-fe.h.
#define PG_COPYRES_EVENTS 0x04 |
Definition at line 68 of file libpq-fe.h.
#define PG_COPYRES_NOTICEHOOKS 0x08 |
Definition at line 69 of file libpq-fe.h.
#define PG_COPYRES_TUPLES 0x02 /* Implies PG_COPYRES_ATTRS */ |
Definition at line 67 of file libpq-fe.h.
#define PQ_QUERY_PARAM_MAX_LIMIT 65535 |
Definition at line 495 of file libpq-fe.h.
#define PQfreeNotify | ( | ptr | ) | PQfreemem(ptr) |
Definition at line 617 of file libpq-fe.h.
#define PQnoPasswordSupplied "fe_sendauth: no password supplied\n" |
Definition at line 621 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 327 of file libpq-fe.h.
#define PQTRACE_REGRESS_MODE (1<<1) |
Definition at line 468 of file libpq-fe.h.
#define PQTRACE_SUPPRESS_TIMESTAMPS (1<<0) |
Definition at line 466 of file libpq-fe.h.
typedef pg_int64 pg_usec_time_t |
Definition at line 226 of file libpq-fe.h.
Definition at line 1 of file libpq-fe.h.
typedef struct pg_cancel_conn PGcancelConn |
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 456 of file libpq-fe.h.
typedef char pqbool |
Definition at line 233 of file libpq-fe.h.
typedef struct _PQconninfoOption PQconninfoOption |
typedef void(* PQnoticeProcessor) (void *arg, const char *message) |
Definition at line 230 of file libpq-fe.h.
Definition at line 229 of file libpq-fe.h.
typedef struct _PQprintOpt PQprintOpt |
Definition at line 733 of file libpq-fe.h.
enum ConnStatusType |
Definition at line 79 of file libpq-fe.h.
enum ExecStatusType |
Definition at line 117 of file libpq-fe.h.
enum PGContextVisibility |
Enumerator | |
---|---|
PQSHOW_CONTEXT_NEVER | |
PQSHOW_CONTEXT_ERRORS | |
PQSHOW_CONTEXT_ALWAYS |
Definition at line 157 of file libpq-fe.h.
enum PGPing |
Enumerator | |
---|---|
PQPING_OK | |
PQPING_REJECT | |
PQPING_NO_RESPONSE | |
PQPING_NO_ATTEMPT |
Definition at line 169 of file libpq-fe.h.
enum PGpipelineStatus |
Enumerator | |
---|---|
PQ_PIPELINE_OFF | |
PQ_PIPELINE_ON | |
PQ_PIPELINE_ABORTED |
Definition at line 180 of file libpq-fe.h.
Enumerator | |
---|---|
PQTRANS_IDLE | |
PQTRANS_ACTIVE | |
PQTRANS_INTRANS | |
PQTRANS_INERROR | |
PQTRANS_UNKNOWN |
Definition at line 140 of file libpq-fe.h.
enum PGVerbosity |
Enumerator | |
---|---|
PQERRORS_TERSE | |
PQERRORS_DEFAULT | |
PQERRORS_VERBOSE | |
PQERRORS_SQLSTATE |
Definition at line 149 of file libpq-fe.h.
Enumerator | |
---|---|
PGRES_POLLING_FAILED | |
PGRES_POLLING_READING | |
PGRES_POLLING_WRITING | |
PGRES_POLLING_OK | |
PGRES_POLLING_ACTIVE |
Definition at line 108 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 549 of file encnames.c.
References clean_encoding_name(), sort-test::key, lengthof, name, NAMEDATALEN, and pg_encname_tbl.
Referenced by pg_valid_client_encoding(), and pg_valid_server_encoding().
const char* pg_encoding_to_char | ( | int | encoding | ) |
Definition at line 587 of file encnames.c.
References Assert, encoding, pg_enc2name::encoding, pg_enc2name::name, pg_enc2name_tbl, and PG_VALID_ENCODING.
int pg_valid_server_encoding_id | ( | int | encoding | ) |
int PQbackendPID | ( | const PGconn * | conn | ) |
Definition at line 7216 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(), send_cancellable_query_impl(), and StartLogStreamer().
int PQbinaryTuples | ( | const PGresult * | res | ) |
Definition at line 3497 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 463 of file fe-cancel.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 DisconnectDatabase(), handle_sigint(), PQrequestCancel(), ShutdownWorkersHard(), sigTermHandler(), and test_cancel().
int PQcancelBlocking | ( | PGcancelConn * | cancelConn | ) |
Definition at line 171 of file fe-cancel.c.
References cancelConn, PQcancelStart(), and pqConnectDBComplete().
Referenced by disconnectDatabase(), test_cancel(), and try_complete_step().
PGcancelConn* PQcancelCreate | ( | PGconn * | conn | ) |
Definition at line 65 of file fe-cancel.c.
References SockAddr::addr, pg_cancel::be_key, pg_conn::be_key, pg_cancel::be_pid, pg_conn::be_pid, calloc, cancelConn, conn, CONNECTION_ALLOCATED, CONNECTION_BAD, pg_conn::connhost, pg_conn_host::host, pg_conn_host::hostaddr, libpq_append_conn_error(), pg_conn_host::password, PGINVALID_SOCKET, pg_conn_host::port, pqConnectOptions2(), pqCopyPGconn(), pqMakeEmptyPGconn(), pqReleaseConnHosts(), pg_conn::raddr, pg_conn::sock, and pg_conn::whichhost.
Referenced by disconnectDatabase(), libpqsrv_cancel(), test_cancel(), and try_complete_step().
char* PQcancelErrorMessage | ( | const PGcancelConn * | cancelConn | ) |
Definition at line 306 of file fe-cancel.c.
References cancelConn, and PQerrorMessage().
Referenced by libpqsrv_cancel(), test_cancel(), and try_complete_step().
void PQcancelFinish | ( | PGcancelConn * | cancelConn | ) |
Definition at line 334 of file fe-cancel.c.
References cancelConn, and PQfinish().
Referenced by disconnectDatabase(), libpqsrv_cancel(), test_cancel(), and try_complete_step().
PostgresPollingStatusType PQcancelPoll | ( | PGcancelConn * | cancelConn | ) |
Definition at line 207 of file fe-cancel.c.
References cancelConn, conn, CONNECTION_AWAITING_RESPONSE, CONNECTION_BAD, CONNECTION_OK, pg_conn::errorMessage, libpq_append_conn_error(), PGRES_POLLING_FAILED, PGRES_POLLING_OK, PGRES_POLLING_READING, PQconnectPoll(), pqReadData(), resetPQExpBuffer(), and pg_conn::status.
Referenced by libpqsrv_cancel(), pqConnectDBComplete(), and test_cancel().
void PQcancelReset | ( | PGcancelConn * | cancelConn | ) |
Definition at line 318 of file fe-cancel.c.
References cancelConn, CONNECTION_ALLOCATED, and pqClosePGconn().
Referenced by test_cancel().
int PQcancelSocket | ( | const PGcancelConn * | cancelConn | ) |
Definition at line 294 of file fe-cancel.c.
References cancelConn, and PQsocket().
Referenced by libpqsrv_cancel(), and test_cancel().
int PQcancelStart | ( | PGcancelConn * | cancelConn | ) |
Definition at line 185 of file fe-cancel.c.
References cancelConn, CONNECTION_ALLOCATED, CONNECTION_BAD, libpq_append_conn_error(), and pqConnectDBStart().
Referenced by libpqsrv_cancel(), PQcancelBlocking(), and test_cancel().
ConnStatusType PQcancelStatus | ( | const PGcancelConn * | cancelConn | ) |
Definition at line 283 of file fe-cancel.c.
References cancelConn, and PQstatus().
Referenced by test_cancel().
Definition at line 1442 of file fe-auth.c.
References buf, conn, initPQExpBuffer(), PQencryptPasswordConn(), PQescapeIdentifier(), PQescapeLiteral(), PQexec(), PQfreemem(), printfPQExpBuffer(), res, termPQExpBuffer(), and user.
Referenced by exec_command_password().
void PQclear | ( | PGresult * | res | ) |
Definition at line 721 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(), and PQmakeEmptyPGresult().
int PQclientEncoding | ( | const PGconn * | conn | ) |
Definition at line 7270 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 2539 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), PqMsg_Close, and PQsendTypedCommand().
Referenced by test_prepared().
Definition at line 2521 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 3752 of file fe-exec.c.
References pg_result::cmdStatus, and res.
Referenced by dblink_exec(), ecpg_process_output(), ExecQueryAndProcessResults(), materializeResult(), PrintQueryStatus(), and test_pipelined_insert().
char* PQcmdTuples | ( | PGresult * | res | ) |
Definition at line 3822 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 1882 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(), GetDbnameFromConnectionOptions(), InitPgFdwOptions(), and main().
PGconn* PQconnectdb | ( | const char * | conninfo | ) |
Definition at line 745 of file fe-connect.c.
References conn, CONNECTION_BAD, pqConnectDBComplete(), PQconnectStart(), and pg_conn::status.
Referenced by connect_database(), get_db_conn(), and main().
PGconn* PQconnectdbParams | ( | const char *const * | keywords, |
const char *const * | values, | ||
int | expand_dbname | ||
) |
Definition at line 690 of file fe-connect.c.
References conn, CONNECTION_BAD, pqConnectDBComplete(), PQconnectStartParams(), pg_conn::status, and values.
Referenced by ConnectDatabase(), connectDatabase(), copy_connection(), doConnect(), ECPGconnect(), GetConnection(), main(), sql_conn(), and vacuumlo().
int PQconnectionNeedsPassword | ( | const PGconn * | conn | ) |
Definition at line 7233 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 7259 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 7248 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 2597 of file fe-connect.c.
References AddrInfo::addr, SockAddr::addr, pg_conn::addr, pg_conn::allowed_enc_methods, appendPQExpBufferChar(), pg_conn::appname, Assert, pg_conn::asyncStatus, AUTH_REQ_OK, pg_conn::auth_req_received, CancelRequestPacket::backendPID, pg_conn::be_key, pg_conn::be_pid, CANCEL_REQUEST_CODE, CancelRequestPacket::cancelAuthCode, pg_conn::cancelRequest, CancelRequestPacket::cancelRequestCode, 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_FAILED, CONNECTION_GSS_STARTUP, CONNECTION_MADE, CONNECTION_NEEDED, CONNECTION_OK, CONNECTION_SSL_STARTUP, CONNECTION_STARTED, connectNoDelay(), pg_conn::connhost, pg_conn::connip, pg_conn::current_enc_method, PQExpBufferData::data, pg_conn::default_transaction_read_only, EINPROGRESS, EINTR, emitHostIdentityInfo(), ENC_GSSAPI, ENC_SSL, ENCRYPTION_NEGOTIATION_FAILED, EnvironmentOptions, err(), ERRCODE_APPNAME_UNKNOWN, ERRCODE_CANNOT_CONNECT_NOW, pg_conn::errorMessage, EWOULDBLOCK, pg_conn::failed_enc_methods, AddrInfo::family, pg_conn::fbappname, free, gai_strerror(), 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, init_allowed_encryption_methods(), pg_conn::inStart, j, pg_conn::laddr, pg_conn::last_sqlstate, PQExpBufferData::len, libpq_append_conn_error(), libpq_gettext, LOAD_BALANCE_RANDOM, pg_conn::load_balance_type, MAX_ERRLEN, MAXPGPATH, MemSet, pg_conn::naddr, pg_conn::nconnhost, NEGOTIATE_GSS_CODE, NEGOTIATE_SSL_CODE, pg_conn::Pfdebug, 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, portstr, 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(), pqParseDone(), pqParseIntParam(), pqReadData(), PQresultErrorField(), PQresultStatus(), pqsecure_open_client(), pqsecure_open_gss(), PQsendQueryContinue(), pqTraceOutputCharResponse(), 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::sslnegotiation, 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 libpqrcv_connect(), libpqsrv_connect_internal(), PQcancelPoll(), pqConnectDBComplete(), pqConnectDBStart(), PQresetPoll(), and wait_until_connected().
PGconn* PQconnectStart | ( | const char * | conninfo | ) |
Definition at line 873 of file fe-connect.c.
References conn, CONNECTION_BAD, connectOptions1(), pqConnectDBStart(), pqConnectOptions2(), pqMakeEmptyPGconn(), 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 792 of file fe-connect.c.
References conn, CONNECTION_BAD, conninfo_array_parse(), pg_conn::errorMessage, fillPGconn(), pqConnectDBStart(), pqConnectOptions2(), PQconninfoFree(), pqMakeEmptyPGconn(), pg_conn::status, and values.
Referenced by do_connect(), libpqrcv_connect(), libpqsrv_connect_params(), PQconnectdbParams(), and PQpingParams().
PQconninfoOption* PQconninfo | ( | PGconn * | conn | ) |
Definition at line 6961 of file fe-connect.c.