|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include <ctype.h>#include <fcntl.h>#include <limits.h>#include <unistd.h>#include "libpq-fe.h"#include "libpq-int.h"#include "mb/pg_wchar.h"
Go to the source code of this file.
Macros | |
| #define | PGRESULT_DATA_BLOCKSIZE 2048 |
| #define | PGRESULT_ALIGN_BOUNDARY MAXIMUM_ALIGNOF /* from configure */ |
| #define | PGRESULT_BLOCK_OVERHEAD Max(sizeof(PGresult_data), PGRESULT_ALIGN_BOUNDARY) |
| #define | PGRESULT_SEP_ALLOC_THRESHOLD (PGRESULT_DATA_BLOCKSIZE / 2) |
| #define | ISFIRSTOCTDIGIT(CH) ((CH) >= '0' && (CH) <= '3') |
| #define | ISOCTDIGIT(CH) ((CH) >= '0' && (CH) <= '7') |
| #define | OCTVAL(CH) ((CH) - '0') |
Functions | |
| static PGEvent * | dupEvents (PGEvent *events, int count, size_t *memSize) |
| static bool | pqAddTuple (PGresult *res, PGresAttValue *tup, const char **errmsgp) |
| static int | PQsendQueryInternal (PGconn *conn, const char *query, bool newQuery) |
| static bool | PQsendQueryStart (PGconn *conn, bool newQuery) |
| static int | PQsendQueryGuts (PGconn *conn, const char *command, const char *stmtName, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat) |
| static void | parseInput (PGconn *conn) |
| static PGresult * | getCopyResult (PGconn *conn, ExecStatusType copytype) |
| static bool | PQexecStart (PGconn *conn) |
| static PGresult * | PQexecFinish (PGconn *conn) |
| static int | PQsendTypedCommand (PGconn *conn, char command, char type, const char *target) |
| static int | check_field_number (const PGresult *res, int field_num) |
| static void | pqPipelineProcessQueue (PGconn *conn) |
| static int | pqPipelineSyncInternal (PGconn *conn, bool immediate_flush) |
| static int | pqPipelineFlush (PGconn *conn) |
| PGresult * | PQmakeEmptyPGresult (PGconn *conn, ExecStatusType status) |
| int | PQsetResultAttrs (PGresult *res, int numAttributes, PGresAttDesc *attDescs) |
| PGresult * | PQcopyResult (const PGresult *src, int flags) |
| int | PQsetvalue (PGresult *res, int tup_num, int field_num, char *value, int len) |
| void * | PQresultAlloc (PGresult *res, size_t nBytes) |
| void * | pqResultAlloc (PGresult *res, size_t nBytes, bool isBinary) |
| size_t | PQresultMemorySize (const PGresult *res) |
| char * | pqResultStrdup (PGresult *res, const char *str) |
| void | pqSetResultError (PGresult *res, PQExpBuffer errorMessage, int offset) |
| void | PQclear (PGresult *res) |
| void | pqClearAsyncResult (PGconn *conn) |
| void | pqSaveErrorResult (PGconn *conn) |
| static void | pqSaveWriteError (PGconn *conn) |
| PGresult * | pqPrepareAsyncResult (PGconn *conn) |
| void | pqInternalNotice (const PGNoticeHooks *hooks, const char *fmt,...) |
| void | pqSaveMessageField (PGresult *res, char code, const char *value) |
| int | pqSaveParameterStatus (PGconn *conn, const char *name, const char *value) |
| int | pqRowProcessor (PGconn *conn, const char **errmsgp) |
| static PGcmdQueueEntry * | pqAllocCmdQueueEntry (PGconn *conn) |
| static void | pqAppendCmdQueueEntry (PGconn *conn, PGcmdQueueEntry *entry) |
| static void | pqRecycleCmdQueueEntry (PGconn *conn, PGcmdQueueEntry *entry) |
| int | PQsendQuery (PGconn *conn, const char *query) |
| int | PQsendQueryContinue (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) |
| static bool | canChangeResultMode (PGconn *conn) |
| int | PQsetSingleRowMode (PGconn *conn) |
| int | PQsetChunkedRowsMode (PGconn *conn, int chunkSize) |
| int | PQconsumeInput (PGconn *conn) |
| int | PQisBusy (PGconn *conn) |
| PGresult * | PQgetResult (PGconn *conn) |
| 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) |
| 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) |
| 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 | PQgetlineAsync (PGconn *conn, char *buffer, int bufsize) |
| int | PQputline (PGconn *conn, const char *string) |
| int | PQputnbytes (PGconn *conn, const char *buffer, int nbytes) |
| int | PQendcopy (PGconn *conn) |
| PGresult * | PQfn (PGconn *conn, int fnid, int *result_buf, int *result_len, int result_is_int, const PQArgBlock *args, int nargs) |
| int | PQenterPipelineMode (PGconn *conn) |
| int | PQexitPipelineMode (PGconn *conn) |
| void | pqCommandQueueAdvance (PGconn *conn, bool isReadyForQuery, bool gotSync) |
| int | PQpipelineSync (PGconn *conn) |
| int | PQsendPipelineSync (PGconn *conn) |
| int | PQsendFlushRequest (PGconn *conn) |
| 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) |
| static int | check_tuple_field_number (const PGresult *res, int tup_num, int field_num) |
| static int | check_param_number (const PGresult *res, int param_num) |
| 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) |
| int | PQsetnonblocking (PGconn *conn, int arg) |
| int | PQisnonblocking (const PGconn *conn) |
| int | PQisthreadsafe (void) |
| int | PQflush (PGconn *conn) |
| void | PQfreemem (void *ptr) |
| void | PQfreeNotify (PGnotify *notify) |
| static size_t | PQescapeStringInternal (PGconn *conn, char *to, const char *from, size_t length, int *error, int encoding, bool std_strings) |
| size_t | PQescapeStringConn (PGconn *conn, char *to, const char *from, size_t length, int *error) |
| size_t | PQescapeString (char *to, const char *from, size_t length) |
| static bool | add_size_overflow (size_t s1, size_t s2, size_t *dst) |
| static char * | PQescapeInternal (PGconn *conn, const char *str, size_t len, bool as_ident) |
| char * | PQescapeLiteral (PGconn *conn, const char *str, size_t len) |
| char * | PQescapeIdentifier (PGconn *conn, const char *str, size_t len) |
| static char | get_hex (char c) |
| static unsigned char * | PQescapeByteaInternal (PGconn *conn, const unsigned char *from, size_t from_length, size_t *to_length, bool std_strings, bool use_hex) |
| unsigned char * | PQescapeByteaConn (PGconn *conn, const unsigned char *from, size_t from_length, size_t *to_length) |
| unsigned char * | PQescapeBytea (const unsigned char *from, size_t from_length, size_t *to_length) |
| unsigned char * | PQunescapeBytea (const unsigned char *strtext, size_t *retbuflen) |
Variables | |
| char *const | pgresStatus [] |
| static const PGresult | OOM_result |
| static int | static_client_encoding = PG_SQL_ASCII |
| static bool | static_std_strings = false |
| static const char | hextbl [] = "0123456789abcdef" |
| static const int8 | hexlookup [128] |
| #define ISFIRSTOCTDIGIT | ( | CH | ) | ((CH) >= '0' && (CH) <= '3') |
| #define PGRESULT_ALIGN_BOUNDARY MAXIMUM_ALIGNOF /* from configure */ |
| #define PGRESULT_BLOCK_OVERHEAD Max(sizeof(PGresult_data), PGRESULT_ALIGN_BOUNDARY) |
| #define PGRESULT_SEP_ALLOC_THRESHOLD (PGRESULT_DATA_BLOCKSIZE / 2) |
|
static |
Definition at line 4231 of file fe-exec.c.
Referenced by PQescapeByteaInternal(), and PQescapeInternal().
|
static |
Definition at line 1941 of file fe-exec.c.
References pg_conn::asyncStatus, pg_conn::cmd_queue_head, conn, PGASYNC_BUSY, pgHavePendingResult, PGQUERY_EXTENDED, PGQUERY_SIMPLE, and PGcmdQueueEntry::queryclass.
Referenced by PQsetChunkedRowsMode(), and PQsetSingleRowMode().
|
static |
Definition at line 3526 of file fe-exec.c.
References pg_result::noticeHooks, pg_result::numAttributes, and pqInternalNotice().
Referenced by PQfformat(), PQfmod(), PQfname(), PQfsize(), PQftable(), PQftablecol(), PQftype(), and PQsetvalue().
|
static |
Definition at line 3564 of file fe-exec.c.
References pg_result::noticeHooks, pg_result::numParameters, and pqInternalNotice().
Referenced by PQparamtype().
|
static |
Definition at line 3541 of file fe-exec.c.
References pg_result::noticeHooks, pg_result::ntups, pg_result::numAttributes, and pqInternalNotice().
Referenced by PQgetisnull(), PQgetlength(), and PQgetvalue().
Definition at line 408 of file fe-exec.c.
References PGEvent::data, free, i, malloc, name, PGEvent::name, PGEvent::passThrough, PGEvent::proc, and PGEvent::resultInitialized.
Referenced by PQcopyResult(), and PQmakeEmptyPGresult().
|
inlinestatic |
Definition at line 4445 of file fe-exec.c.
References hexlookup.
Referenced by PQunescapeBytea().
|
static |
Definition at line 2240 of file fe-exec.c.
References pg_conn::asyncStatus, conn, CONNECTION_OK, PGASYNC_IDLE, PQmakeEmptyPGresult(), pqPrepareAsyncResult(), pqSaveErrorResult(), pg_conn::result, pg_result::resultStatus, and pg_conn::status.
Referenced by PQgetResult().
|
static |
Definition at line 2036 of file fe-exec.c.
References conn, and pqParseInput3().
Referenced by PQgetResult(), PQisBusy(), PQnotifies(), and PQputCopyData().
|
static |
Definition at line 998 of file fe-exec.c.
References if(), libpq_gettext, malloc, pg_result::memorySize, pg_result::ntups, realloc, pg_result::tupArrSize, and pg_result::tuples.
Referenced by pqRowProcessor(), and PQsetvalue().
|
static |
Definition at line 1322 of file fe-exec.c.
References pg_conn::cmd_queue_recycle, conn, libpq_append_conn_error(), malloc, PGcmdQueueEntry::next, and PGcmdQueueEntry::query.
Referenced by pqPipelineSyncInternal(), PQsendPrepare(), PQsendQueryGuts(), PQsendQueryInternal(), and PQsendTypedCommand().
|
static |
Definition at line 1355 of file fe-exec.c.
References Assert(), pg_conn::asyncStatus, pg_conn::cmd_queue_head, pg_conn::cmd_queue_tail, conn, PGcmdQueueEntry::next, PGASYNC_BUSY, PGASYNC_IDLE, PGASYNC_PIPELINE_IDLE, pg_conn::pipelineStatus, PQ_PIPELINE_ABORTED, PQ_PIPELINE_OFF, PQ_PIPELINE_ON, and pqPipelineProcessQueue().
Referenced by pqPipelineSyncInternal(), PQsendPrepare(), PQsendQueryGuts(), PQsendQueryInternal(), and PQsendTypedCommand().
| int PQbinaryTuples | ( | const PGresult * | res | ) |
Definition at line 3513 of file fe-exec.c.
References pg_result::binary.
Referenced by HandleCopyResult().
| void PQclear | ( | PGresult * | res | ) |
Definition at line 726 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, PGEventResultDestroy::result, PGEvent::resultInitialized, and pg_result::tuples.
Referenced by pqClearAsyncResult(), PQcopyResult(), PQexecFinish(), PQexecStart(), pqInternalNotice(), and PQmakeEmptyPGresult().
| void pqClearAsyncResult | ( | PGconn * | conn | ) |
Definition at line 784 of file fe-exec.c.
References conn, pg_conn::error_result, PQclear(), pg_conn::result, and pg_conn::saved_result.
Referenced by getAnotherTuple(), getParamDescriptions(), getRowDescriptions(), pqClosePGconn(), PQconnectPoll(), pqGetErrorNotice3(), pqPipelineProcessQueue(), pqSaveErrorResult(), and PQsendQueryStart().
Definition at line 2555 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), PqMsg_Close, and PQsendTypedCommand().
Referenced by test_prepared().
Definition at line 2537 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 3768 of file fe-exec.c.
References pg_result::cmdStatus.
| char * PQcmdTuples | ( | PGresult * | res | ) |
Definition at line 3838 of file fe-exec.c.
References pg_result::cmdStatus, pg_result::noticeHooks, and pqInternalNotice().
| void pqCommandQueueAdvance | ( | PGconn * | conn, |
| bool | isReadyForQuery, | ||
| bool | gotSync | ||
| ) |
Definition at line 3158 of file fe-exec.c.
References pg_conn::cmd_queue_head, pg_conn::cmd_queue_tail, conn, PGcmdQueueEntry::next, PGQUERY_SIMPLE, PGQUERY_SYNC, pqRecycleCmdQueueEntry(), and PGcmdQueueEntry::queryclass.
Referenced by PQgetResult(), and pqParseInput3().
| int PQconsumeInput | ( | PGconn * | conn | ) |
Definition at line 2000 of file fe-exec.c.
References conn, pqFlush(), pqIsnonblocking, and pqReadData().
Referenced by advanceConnectionState(), consume_query_cancel_impl(), CopyStreamReceive(), dblink_get_notify(), dblink_is_busy(), do_sql_command_end(), ecpg_process_output(), libpqrcv_receive(), libpqsrv_get_result(), main(), pgfdw_cancel_query_end(), pgfdw_exec_cleanup_query_end(), pgfdw_get_cleanup_result(), postgresForeignAsyncNotify(), PQconnectPoll(), PrintNotifications(), process_slot(), StreamLogicalLog(), test_nosync(), test_pipelined_insert(), test_uniqviol(), try_complete_step(), and wait_on_slots().
Definition at line 318 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().
Definition at line 2490 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), PqMsg_Describe, and PQsendTypedCommand().
Referenced by test_prepared().
Definition at line 2471 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), PqMsg_Describe, PQsendTypedCommand(), and stmt.
Referenced by DescribeQuery(), ECPGdescribe(), and test_prepared().
| int PQendcopy | ( | PGconn * | conn | ) |
Definition at line 2965 of file fe-exec.c.
References conn, and pqEndcopy3().
Referenced by ecpg_check_PQresult(), initPopulateTable(), libpqrcv_endstreaming(), and readCommandResponse().
| int PQenterPipelineMode | ( | PGconn * | conn | ) |
Definition at line 3058 of file fe-exec.c.
References pg_conn::asyncStatus, conn, libpq_append_conn_error(), PGASYNC_IDLE, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, and PQ_PIPELINE_ON.
Referenced by ExecQueryAndProcessResults(), executeMetaCommand(), test_disallowed_in_pipeline(), test_multi_pipelines(), test_nosync(), test_pipeline_abort(), test_pipeline_idle(), test_pipelined_insert(), test_prepared(), test_simple_pipeline(), test_singlerowmode(), test_transaction(), and test_uniqviol().
| unsigned char * PQescapeBytea | ( | const unsigned char * | from, |
| size_t | from_length, | ||
| size_t * | to_length | ||
| ) |
Definition at line 4612 of file fe-exec.c.
References PQescapeByteaInternal(), and static_std_strings.
| unsigned char * PQescapeByteaConn | ( | PGconn * | conn, |
| const unsigned char * | from, | ||
| size_t | from_length, | ||
| size_t * | to_length | ||
| ) |
Definition at line 4596 of file fe-exec.c.
References pg_conn::cmd_queue_head, conn, pqClearConnErrorState, PQescapeByteaInternal(), pg_conn::std_strings, and pg_conn::sversion.
|
static |
Definition at line 4472 of file fe-exec.c.
References add_size_overflow(), conn, hextbl, i, len, libpq_append_conn_error(), and malloc.
Referenced by PQescapeBytea(), and PQescapeByteaConn().
| char * PQescapeIdentifier | ( | PGconn * | conn, |
| const char * | str, | ||
| size_t | len | ||
| ) |
Definition at line 4425 of file fe-exec.c.
References conn, len, PQescapeInternal(), and str.
Referenced by create_publication(), create_subscription(), drop_publication(), enable_subscription(), escape_identifier(), initCreatePKeys(), initCreateTables(), main(), PQchangePassword(), psql_get_variable(), stringlist_to_identifierstr(), and vacuumlo().
|
static |
Definition at line 4251 of file fe-exec.c.
References add_size_overflow(), pg_conn::client_encoding, pg_conn::cmd_queue_head, conn, i, IS_HIGHBIT_SET, len, libpq_append_conn_error(), malloc, pg_encoding_mblen(), pg_encoding_mblen_or_incomplete(), pg_encoding_verifymbstr(), pqClearConnErrorState, remaining, str, and strnlen().
Referenced by PQescapeIdentifier(), and PQescapeLiteral().
| char * PQescapeLiteral | ( | PGconn * | conn, |
| const char * | str, | ||
| size_t | len | ||
| ) |
Definition at line 4419 of file fe-exec.c.
References conn, len, PQescapeInternal(), and str.
Referenced by check_and_drop_existing_subscriptions(), create_logical_replication_slot(), create_publication(), create_subscription(), DescribeQuery(), drop_replication_slot(), escape_literal(), libpqrcv_startstreaming(), PQchangePassword(), psql_get_variable(), set_locale_and_encoding(), set_replication_progress(), and test_gb18030_page_multiple().
| size_t PQescapeString | ( | char * | to, |
| const char * | from, | ||
| size_t | length | ||
| ) |
Definition at line 4215 of file fe-exec.c.
References PQescapeStringInternal(), static_client_encoding, and static_std_strings.
Referenced by escape_string(), get_comma_elts(), and quote_postgres().
| size_t PQescapeStringConn | ( | PGconn * | conn, |
| char * | to, | ||
| const char * | from, | ||
| size_t | length, | ||
| int * | error | ||
| ) |
Definition at line 4193 of file fe-exec.c.
References pg_conn::client_encoding, pg_conn::cmd_queue_head, conn, error(), pqClearConnErrorState, PQescapeStringInternal(), and pg_conn::std_strings.
Referenced by AppendStringCommandOption(), appendStringLiteralConn(), check_loadable_libraries(), do_lo_import(), and escape_string_conn().
|
static |
Definition at line 4087 of file fe-exec.c.
References conn, encoding, error(), i, IS_HIGHBIT_SET, libpq_append_conn_error(), pg_encoding_mblen_or_incomplete(), pg_encoding_set_invalid(), pg_encoding_verifymbchar(), remaining, source, SQL_STR_DOUBLE, and strnlen().
Referenced by PQescapeString(), and PQescapeStringConn().
Definition at line 2278 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), and PQsendQuery().
Referenced by _doSetSessionAuth(), _printTableAccessMethodNoStorage(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), check_and_drop_existing_subscriptions(), check_and_drop_publications(), check_loadable_libraries(), check_prepare_conn(), check_publisher(), check_subscriber(), connect_database(), create_logical_replication_slot(), create_publication(), create_subscription(), CreateReplicationSlot(), deallocate_one(), DescribeQuery(), drop_existing_subscription(), drop_failover_replication_slots(), drop_publication(), drop_replication_slot(), DropReplicationSlot(), ecpg_autostart_transaction(), ecpg_execute(), ecpg_is_type_an_array(), ECPGsetcommit(), ECPGtrans(), enable_subscription(), executeCommand(), executeMaintenanceCommand(), executeQuery(), executeQueryOrDie(), ExecuteSqlCommand(), ExecuteSqlQuery(), ExecuteSqlStatement(), executeStatement(), generate_object_name(), get_create_object_cmd(), get_primary_sysid(), get_publisher_databases(), GetConnection(), GetSlotInformation(), GetTableInfo(), init_libpq_conn(), initPopulateTable(), libpq_traverse_files(), lo_initialize(), lockTableForWorker(), lookup_object_oid(), main(), PQchangePassword(), PQencryptPasswordConn(), PQsetClientEncoding(), PSQLexec(), ReceiveXlogStream(), RetrieveDataDirCreatePerm(), RetrieveWalSegSize(), run_permutation(), run_simple_command(), run_simple_query(), RunIdentifySystem(), SendQuery(), server_is_in_recovery(), set_replication_progress(), setup_publisher(), sql_conn(), sql_exec(), StreamLogicalLog(), test_disallowed_in_pipeline(), test_pipeline_abort(), test_prepared(), test_transaction(), test_uniqviol(), tryExecuteStatement(), and vacuumlo().
Definition at line 2426 of file fe-exec.c.
References conn, CONNECTION_BAD, PGRES_COPY_BOTH, PGRES_COPY_IN, PGRES_COPY_OUT, PQclear(), PQgetResult(), pg_result::resultStatus, and pg_conn::status.
Referenced by PQclosePortal(), PQclosePrepared(), PQdescribePortal(), PQdescribePrepared(), PQexec(), PQexecParams(), PQexecPrepared(), and PQprepare().
| PGresult * PQexecParams | ( | PGconn * | conn, |
| const char * | command, | ||
| int | nParams, | ||
| const Oid * | paramTypes, | ||
| const char *const * | paramValues, | ||
| const int * | paramLengths, | ||
| const int * | paramFormats, | ||
| int | resultFormat | ||
| ) |
Definition at line 2292 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), and PQsendQueryParams().
Referenced by ecpg_execute(), get_table_relkind(), libpq_fetch_file(), main(), and wait_for_connection_state().
| PGresult * PQexecPrepared | ( | PGconn * | conn, |
| const char * | stmtName, | ||
| int | nParams, | ||
| const char *const * | paramValues, | ||
| const int * | paramLengths, | ||
| const int * | paramFormats, | ||
| int | resultFormat | ||
| ) |
Definition at line 2339 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), and PQsendQueryPrepared().
Referenced by ecpg_execute(), and try_complete_step().
|
static |
Definition at line 2360 of file fe-exec.c.
References pg_conn::asyncStatus, pg_conn::cmd_queue_head, conn, CONNECTION_BAD, libpq_append_conn_error(), libpq_gettext, PGASYNC_BUSY, PGRES_COPY_BOTH, PGRES_COPY_IN, PGRES_COPY_OUT, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, PQclear(), pqClearConnErrorState, PQgetResult(), PQputCopyEnd(), pg_result::resultStatus, and pg_conn::status.
Referenced by PQclosePortal(), PQclosePrepared(), PQdescribePortal(), PQdescribePrepared(), PQexec(), PQexecParams(), PQexecPrepared(), and PQprepare().
| int PQexitPipelineMode | ( | PGconn * | conn | ) |
Definition at line 3089 of file fe-exec.c.
References pg_conn::asyncStatus, pg_conn::cmd_queue_head, conn, libpq_append_conn_error(), PGASYNC_BUSY, PGASYNC_COPY_BOTH, PGASYNC_COPY_IN, PGASYNC_COPY_OUT, PGASYNC_IDLE, PGASYNC_PIPELINE_IDLE, PGASYNC_READY, PGASYNC_READY_MORE, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, and pqFlush().
Referenced by discardUntilSync(), ExecQueryAndProcessResults(), readCommandResponse(), test_disallowed_in_pipeline(), test_multi_pipelines(), test_pipeline_abort(), test_pipeline_idle(), test_pipelined_insert(), test_prepared(), test_simple_pipeline(), test_singlerowmode(), and test_transaction().
| int PQfformat | ( | const PGresult * | res, |
| int | field_num | ||
| ) |
Definition at line 3724 of file fe-exec.c.
References pg_result::attDescs, check_field_number(), and pgresAttDesc::format.
Referenced by ecpg_get_data(), ecpg_store_result(), and process_queued_fetch_requests().
| int PQflush | ( | PGconn * | conn | ) |
Definition at line 4016 of file fe-exec.c.
References conn, CONNECTION_BAD, pqFlush(), and pg_conn::status.
Referenced by CheckCopyStreamStop(), ExecQueryAndProcessResults(), HandleEndOfCopyStream(), libpqrcv_endstreaming(), libpqrcv_send(), prepareToTerminate(), ProcessWALDataMsg(), sendFeedback(), test_nosync(), test_pipelined_insert(), and test_uniqviol().
| int PQfmod | ( | const PGresult * | res, |
| int | field_num | ||
| ) |
Definition at line 3757 of file fe-exec.c.
References pg_result::attDescs, pgresAttDesc::atttypmod, and check_field_number().
Referenced by DescribeQuery(), and ECPGget_desc().
| PGresult * PQfn | ( | PGconn * | conn, |
| int | fnid, | ||
| int * | result_buf, | ||
| int * | result_len, | ||
| int | result_is_int, | ||
| const PQArgBlock * | args, | ||
| int | nargs | ||
| ) |
Definition at line 2996 of file fe-exec.c.
References generate_unaccent_rules::args, pg_conn::asyncStatus, pg_conn::cmd_queue_head, conn, libpq_append_conn_error(), PGASYNC_IDLE, pgHavePendingResult, PGINVALID_SOCKET, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, pqClearConnErrorState, pqFunctionCall3(), and pg_conn::sock.
Referenced by lo_close(), lo_creat(), lo_create(), lo_lseek(), lo_lseek64(), lo_open(), lo_read(), lo_tell(), lo_tell64(), lo_truncate(), lo_truncate64(), lo_unlink(), and lo_write().
| char * PQfname | ( | const PGresult * | res, |
| int | field_num | ||
| ) |
Definition at line 3583 of file fe-exec.c.
References pg_result::attDescs, check_field_number(), and pgresAttDesc::name.
| int PQfnumber | ( | const PGresult * | res, |
| const char * | field_name | ||
| ) |
Definition at line 3605 of file fe-exec.c.
References pg_result::attDescs, free, i, pgresAttDesc::name, pg_result::numAttributes, and pg_tolower().
Referenced by append_depends_on_extension(), binary_upgrade_set_type_oids_by_type_oid(), buildMatViewRefreshDependencies(), check_for_connection_status(), check_for_pg_role_prefix(), check_new_cluster_replication_slots(), collectComments(), collectSecLabels(), describeOneTableDetails(), dropRoles(), dumpAgg(), dumpBaseType(), dumpCollation(), dumpCompositeType(), dumpCompositeTypeColComments(), dumpConversion(), dumpDatabase(), dumpDomain(), dumpEnumType(), dumpFunc(), dumpOpclass(), dumpOpfamily(), dumpOpr(), dumpRangeType(), dumpRelationStats_dumper(), dumpRoleMembership(), dumpRoles(), dumpTableSchema(), dumpTSConfig(), dumpUserMappings(), get_db_infos(), get_subscription_info(), get_tablespace_paths(), get_template0_info(), getAccessMethods(), getAggregates(), getCasts(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getDependencies(), getDomainConstraints(), getEventTriggers(), getExtendedStatistics(), getExtensionMembership(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFuncs(), getIndexes(), getInherits(), getLOs(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getPolicies(), getProcLangs(), getPublicationNamespaces(), getPublications(), getPublicationTables(), getRules(), getSubscriptionRelations(), getSubscriptions(), getTableAttrs(), getTables(), getTransforms(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), old_9_6_invalidate_hash_indexes(), process_data_type_check(), process_extension_updates(), process_incompat_polymorphics(), process_inconsistent_notnull(), process_isn_and_int8_passing_mismatch(), process_old_cluster_logical_slot_infos(), process_old_sub_state_check(), process_rel_infos(), process_unicode_update(), process_user_defined_encoding_conversions(), process_user_defined_postfix_ops(), process_with_oids_check(), processExtensionTables(), set_frozenxids(), and show_binary_results().
| void PQfreemem | ( | void * | ptr | ) |
Definition at line 4048 of file fe-exec.c.
References free.
Referenced by check_and_drop_existing_subscriptions(), create_logical_replication_slot(), create_publication(), create_subscription(), dblink_get_notify(), DescribeQuery(), do_connect(), drop_publication(), drop_replication_slot(), dumpTableData_copy(), ecpg_process_output(), enable_subscription(), escape_identifier(), escape_literal(), exec_command_errverbose(), get_base_conninfo(), handleCopyOut(), HandleCopyStream(), initCreatePKeys(), initCreateTables(), libpqrcv_check_conninfo(), libpqrcv_disconnect(), libpqrcv_get_dbname_from_conninfo(), libpqrcv_receive(), libpqrcv_startstreaming(), main(), PQchangePassword(), PQfreeNotify(), PrintNotifications(), psql_get_variable(), ReceiveCopyData(), set_locale_and_encoding(), set_replication_progress(), StreamLogicalLog(), stringlist_to_identifierstr(), try_complete_step(), and vacuumlo().
| void PQfreeNotify | ( | PGnotify * | notify | ) |
Definition at line 4065 of file fe-exec.c.
References PQfreemem().
| int PQfsize | ( | const PGresult * | res, |
| int | field_num | ||
| ) |
Definition at line 3746 of file fe-exec.c.
References pg_result::attDescs, check_field_number(), and pgresAttDesc::typlen.
Referenced by ecpg_build_compat_sqlda(), and ECPGget_desc().
Definition at line 3702 of file fe-exec.c.
References pg_result::attDescs, check_field_number(), InvalidOid, and pgresAttDesc::tableid.
| int PQftablecol | ( | const PGresult * | res, |
| int | field_num | ||
| ) |
Definition at line 3713 of file fe-exec.c.
References pg_result::attDescs, check_field_number(), and pgresAttDesc::columnid.
Definition at line 3735 of file fe-exec.c.
References pg_result::attDescs, check_field_number(), InvalidOid, and pgresAttDesc::typid.
Referenced by DescribeQuery(), dumpTableData_insert(), ecpg_build_compat_sqlda(), ecpg_build_native_sqlda(), ecpg_store_result(), ECPGget_desc(), printCrosstab(), printQuery(), process_queued_fetch_requests(), sqlda_common_total_size(), and test_prepared().
| int PQgetCopyData | ( | PGconn * | conn, |
| char ** | buffer, | ||
| int | async | ||
| ) |
Definition at line 2832 of file fe-exec.c.
References pg_conn::asyncStatus, conn, libpq_append_conn_error(), PGASYNC_COPY_BOTH, PGASYNC_COPY_OUT, and pqGetCopyData3().
Referenced by CopyStreamReceive(), dumpTableData_copy(), ecpg_process_output(), handleCopyOut(), libpqrcv_receive(), ReceiveCopyData(), and StreamLogicalLog().
| int PQgetisnull | ( | const PGresult * | res, |
| int | tup_num, | ||
| int | field_num | ||
| ) |
Definition at line 3917 of file fe-exec.c.
References check_tuple_field_number(), pgresAttValue::len, NULL_LEN, and pg_result::tuples.
| int PQgetlength | ( | const PGresult * | res, |
| int | tup_num, | ||
| int | field_num | ||
| ) |
Definition at line 3903 of file fe-exec.c.
References check_tuple_field_number(), pgresAttValue::len, NULL_LEN, and pg_result::tuples.
| int PQgetline | ( | PGconn * | conn, |
| char * | buffer, | ||
| int | length | ||
| ) |
Definition at line 2870 of file fe-exec.c.
References conn, and pqGetline3().
| int PQgetlineAsync | ( | PGconn * | conn, |
| char * | buffer, | ||
| int | bufsize | ||
| ) |
Definition at line 2917 of file fe-exec.c.
References bufsize, conn, and pqGetlineAsync3().
Referenced by pqGetline3().
Definition at line 2078 of file fe-exec.c.
References Assert(), pg_conn::asyncStatus, conn, getCopyResult(), libpq_append_conn_error(), pg_result::nEvents, parseInput(), PGASYNC_BUSY, PGASYNC_COPY_BOTH, PGASYNC_COPY_IN, PGASYNC_COPY_OUT, PGASYNC_IDLE, PGASYNC_PIPELINE_IDLE, PGASYNC_READY, PGASYNC_READY_MORE, PGRES_COPY_BOTH, PGRES_COPY_IN, PGRES_COPY_OUT, PGRES_PIPELINE_SYNC, PGRES_TUPLES_CHUNK, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, pqCommandQueueAdvance(), PQfireResultCreateEvents(), pqFlush(), pqPipelineProcessQueue(), pqPrepareAsyncResult(), pqReadData(), pqSaveErrorResult(), pqSaveWriteError(), pqWait(), pg_conn::result, pg_result::resultStatus, and pg_conn::write_failed.
Referenced by PQexecFinish(), and PQexecStart().
| char * PQgetvalue | ( | const PGresult * | res, |
| int | tup_num, | ||
| int | field_num | ||
| ) |
Definition at line 3892 of file fe-exec.c.
References check_tuple_field_number(), pg_result::tuples, and pgresAttValue::value.
| void pqInternalNotice | ( | const PGNoticeHooks * | hooks, |
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 943 of file fe-exec.c.
References generate_unaccent_rules::args, pg_result::errMsg, libpq_gettext, pg_result::noticeHooks, PGNoticeHooks::noticeRec, PGNoticeHooks::noticeRecArg, PG_DIAG_MESSAGE_PRIMARY, PG_DIAG_SEVERITY, PG_DIAG_SEVERITY_NONLOCALIZED, PGRES_NONFATAL_ERROR, PQclear(), PQmakeEmptyPGresult(), pqResultAlloc(), pqSaveMessageField(), sprintf, and vsnprintf.
Referenced by check_field_number(), check_param_number(), check_tuple_field_number(), PQcmdTuples(), pqEndcopy3(), pqGetInt(), pqParseInput3(), pqPutInt(), and PQsetvalue().
| int PQisBusy | ( | PGconn * | conn | ) |
Definition at line 2047 of file fe-exec.c.
References pg_conn::asyncStatus, conn, CONNECTION_BAD, parseInput(), PGASYNC_BUSY, and pg_conn::status.
Referenced by advanceConnectionState(), consume_query_cancel_impl(), dblink_is_busy(), libpqsrv_get_result(), pgfdw_get_cleanup_result(), PQconnectPoll(), pqEndcopy3(), process_slot(), test_disallowed_in_pipeline(), test_pipelined_insert(), test_uniqviol(), try_complete_step(), and wait_on_slots().
| int PQisnonblocking | ( | const PGconn * | conn | ) |
Definition at line 3999 of file fe-exec.c.
References conn, CONNECTION_BAD, pqIsnonblocking, and pg_conn::status.
Referenced by test_disallowed_in_pipeline(), and test_simple_pipeline().
| int PQisthreadsafe | ( | void | ) |
| PGresult * PQmakeEmptyPGresult | ( | PGconn * | conn, |
| ExecStatusType | status | ||
| ) |
Definition at line 159 of file fe-exec.c.
References pg_result::attDescs, pg_result::binary, pg_result::client_encoding, pg_conn::client_encoding, pg_result::cmdStatus, conn, pg_result::curBlock, pg_result::curOffset, dupEvents(), pg_result::errFields, pg_result::errMsg, pg_conn::errorMessage, pg_result::errQuery, pg_result::events, pg_conn::events, malloc, pg_result::memorySize, pg_result::nEvents, pg_conn::nEvents, pg_result::noticeHooks, pg_conn::noticeHooks, PGNoticeHooks::noticeProc, PGNoticeHooks::noticeProcArg, PGNoticeHooks::noticeRec, PGNoticeHooks::noticeRecArg, pg_result::ntups, pg_result::null_field, pg_result::numAttributes, pg_result::numParameters, pg_result::paramDescs, PG_SQL_ASCII, PGRES_COMMAND_OK, PGRES_COPY_BOTH, PGRES_COPY_IN, PGRES_COPY_OUT, PGRES_EMPTY_QUERY, PGRES_SINGLE_TUPLE, PGRES_TUPLES_CHUNK, PGRES_TUPLES_OK, PQclear(), pqSetResultError(), pg_result::resultStatus, pg_result::spaceLeft, pg_result::tupArrSize, and pg_result::tuples.
Referenced by ECPGallocate_desc(), getCopyResult(), getCopyStart(), getParamDescriptions(), getRowDescriptions(), PQcopyResult(), pqFunctionCall3(), pqGetErrorNotice3(), pqInternalNotice(), pqParseInput3(), pqPipelineProcessQueue(), and pqPrepareAsyncResult().
| int PQnfields | ( | const PGresult * | res | ) |
Definition at line 3505 of file fe-exec.c.
References pg_result::numAttributes.
Definition at line 2683 of file fe-exec.c.
References conn, pgNotify::next, pg_conn::notifyHead, pg_conn::notifyTail, and parseInput().
Referenced by dblink_get_notify(), ecpg_process_output(), main(), PrintNotifications(), and try_complete_step().
| int PQnparams | ( | const PGresult * | res | ) |
Definition at line 3931 of file fe-exec.c.
References pg_result::numParameters.
| int PQntuples | ( | const PGresult * | res | ) |
Definition at line 3497 of file fe-exec.c.
References pg_result::ntups.
| char * PQoidStatus | ( | const PGresult * | res | ) |
Definition at line 3781 of file fe-exec.c.
References buf, pg_result::cmdStatus, and len.
Definition at line 3809 of file fe-exec.c.
References pg_result::cmdStatus, and InvalidOid.
Referenced by ecpg_process_output(), and PrintQueryStatus().
Definition at line 3942 of file fe-exec.c.
References check_param_number(), InvalidOid, pg_result::paramDescs, and pgresParamDesc::typid.
|
static |
Definition at line 4032 of file fe-exec.c.
References conn, OUTBUFFER_THRESHOLD, pg_conn::outCount, pg_conn::pipelineStatus, PQ_PIPELINE_ON, and pqFlush().
Referenced by pqPipelineSyncInternal(), PQsendFlushRequest(), PQsendPrepare(), PQsendQueryGuts(), and PQsendTypedCommand().
|
static |
Definition at line 3196 of file fe-exec.c.
References Assert(), pg_conn::asyncStatus, pg_conn::cmd_queue_head, conn, libpq_append_conn_error(), pg_conn::maxChunkSize, pg_conn::partialResMode, PGASYNC_BUSY, PGASYNC_COPY_BOTH, PGASYNC_COPY_IN, PGASYNC_COPY_OUT, PGASYNC_IDLE, PGASYNC_PIPELINE_IDLE, PGASYNC_READY, PGASYNC_READY_MORE, PGQUERY_SYNC, PGRES_PIPELINE_ABORTED, pg_conn::pipelineStatus, PQ_PIPELINE_ABORTED, PQ_PIPELINE_OFF, pqClearAsyncResult(), pqClearConnErrorState, PQmakeEmptyPGresult(), pqSaveErrorResult(), PGcmdQueueEntry::queryclass, pg_conn::result, and pg_conn::singleRowMode.
Referenced by pqAppendCmdQueueEntry(), and PQgetResult().
| int PQpipelineSync | ( | PGconn * | conn | ) |
Definition at line 3288 of file fe-exec.c.
References conn, and pqPipelineSyncInternal().
Referenced by discardUntilSync(), ExecQueryAndProcessResults(), executeMetaCommand(), test_multi_pipelines(), test_pipeline_abort(), test_pipelined_insert(), test_prepared(), test_simple_pipeline(), test_singlerowmode(), and test_transaction().
|
static |
Definition at line 3310 of file fe-exec.c.
References appendPQExpBufferStr(), pg_conn::asyncStatus, conn, pg_conn::errorMessage, libpq_append_conn_error(), PGASYNC_BUSY, PGASYNC_COPY_BOTH, PGASYNC_COPY_IN, PGASYNC_COPY_OUT, PGASYNC_IDLE, PGASYNC_PIPELINE_IDLE, PGASYNC_READY, PGASYNC_READY_MORE, PGQUERY_SYNC, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, pqAllocCmdQueueEntry(), pqAppendCmdQueueEntry(), pqFlush(), PqMsg_Sync, pqPipelineFlush(), pqPutMsgEnd(), pqPutMsgStart(), pqRecycleCmdQueueEntry(), PGcmdQueueEntry::query, and PGcmdQueueEntry::queryclass.
Referenced by PQpipelineSync(), and PQsendPipelineSync().
| PGresult * PQprepare | ( | PGconn * | conn, |
| const char * | stmtName, | ||
| const char * | query, | ||
| int | nParams, | ||
| const Oid * | paramTypes | ||
| ) |
Definition at line 2322 of file fe-exec.c.
References conn, PQexecFinish(), PQexecStart(), and PQsendPrepare().
Referenced by DescribeQuery(), init_libpq_conn(), main(), prepare_common(), prepareCommand(), and test_uniqviol().
Definition at line 856 of file fe-exec.c.
References conn, pg_conn::error_result, pg_conn::errorMessage, pg_conn::errorReported, PQExpBufferData::len, libpq_append_conn_error(), OOM_result, PGRES_EMPTY_QUERY, PGRES_FATAL_ERROR, PQmakeEmptyPGresult(), pqSetResultError(), pg_conn::result, pg_result::resultStatus, pg_conn::saved_result, and unconstify.
Referenced by getCopyResult(), pqFunctionCall3(), and PQgetResult().
| int PQputCopyData | ( | PGconn * | conn, |
| const char * | buffer, | ||
| int | nbytes | ||
| ) |
Definition at line 2711 of file fe-exec.c.
References pg_conn::asyncStatus, conn, libpq_append_conn_error(), pg_conn::outBufSize, pg_conn::outCount, parseInput(), PGASYNC_COPY_BOTH, PGASYNC_COPY_IN, pqCheckOutBufferSpace(), pqFlush(), pqIsnonblocking, PqMsg_CopyData, pqPutMsgEnd(), pqPutMsgStart(), and pqPutnchar().
Referenced by BaseBackup(), ExecuteSqlCommandBuf(), handleCopyIn(), libpqrcv_send(), PQputnbytes(), and sendFeedback().
| int PQputCopyEnd | ( | PGconn * | conn, |
| const char * | errormsg | ||
| ) |
Definition at line 2765 of file fe-exec.c.
References pg_conn::asyncStatus, pg_conn::cmd_queue_head, conn, libpq_append_conn_error(), PGASYNC_BUSY, PGASYNC_COPY_BOTH, PGASYNC_COPY_IN, PGASYNC_COPY_OUT, PGQUERY_SIMPLE, pqFlush(), PqMsg_CopyDone, PqMsg_CopyFail, PqMsg_Sync, pqPutMsgEnd(), pqPutMsgStart(), pqPuts(), and PGcmdQueueEntry::queryclass.
Referenced by BaseBackup(), CheckCopyStreamStop(), EndDBCopyMode(), handleCopyIn(), HandleEndOfCopyStream(), libpqrcv_endstreaming(), PQexecStart(), prepareToTerminate(), and ProcessWALDataMsg().
| int PQputline | ( | PGconn * | conn, |
| const char * | string | ||
| ) |
Definition at line 2934 of file fe-exec.c.
References conn, and PQputnbytes().
Referenced by initPopulateTable().
| int PQputnbytes | ( | PGconn * | conn, |
| const char * | buffer, | ||
| int | nbytes | ||
| ) |
Definition at line 2944 of file fe-exec.c.
References conn, and PQputCopyData().
Referenced by PQputline().
|
static |
Definition at line 1402 of file fe-exec.c.
References Assert(), pg_conn::cmd_queue_recycle, conn, free, PGcmdQueueEntry::next, and PGcmdQueueEntry::query.
Referenced by pqCommandQueueAdvance(), pqPipelineSyncInternal(), PQsendPrepare(), PQsendQueryGuts(), PQsendQueryInternal(), and PQsendTypedCommand().
| char * PQresStatus | ( | ExecStatusType | status | ) |
Definition at line 3435 of file fe-exec.c.
References lengthof, libpq_gettext, and pgresStatus.
Referenced by BaseBackup(), confirm_result_status_impl(), consume_null_result_impl(), process_result(), test_pipeline_abort(), test_pipelined_insert(), test_prepared(), test_singlerowmode(), test_transaction(), and try_complete_step().
| void * PQresultAlloc | ( | PGresult * | res, |
| size_t | nBytes | ||
| ) |
Definition at line 543 of file fe-exec.c.
References OOM_result, and pqResultAlloc().
Referenced by PQsetResultAttrs().
| void * pqResultAlloc | ( | PGresult * | res, |
| size_t | nBytes, | ||
| bool | isBinary | ||
| ) |
Definition at line 563 of file fe-exec.c.
References pg_result::curBlock, pg_result::curOffset, malloc, pg_result::memorySize, pgresult_data::next, pg_result::null_field, PGRESULT_ALIGN_BOUNDARY, PGRESULT_BLOCK_OVERHEAD, PGRESULT_DATA_BLOCKSIZE, PGRESULT_SEP_ALLOC_THRESHOLD, pgresult_data::space, and pg_result::spaceLeft.
Referenced by getCopyStart(), getParamDescriptions(), getRowDescriptions(), pqInternalNotice(), PQresultAlloc(), pqResultStrdup(), pqRowProcessor(), pqSaveMessageField(), and PQsetvalue().
| char * PQresultErrorField | ( | const PGresult * | res, |
| int | fieldcode | ||
| ) |
Definition at line 3482 of file fe-exec.c.
References pgMessageField::code, pgMessageField::contents, pg_result::errFields, and pgMessageField::next.
| char * PQresultErrorMessage | ( | const PGresult * | res | ) |
Definition at line 3443 of file fe-exec.c.
References pg_result::errMsg.
| size_t PQresultMemorySize | ( | const PGresult * | res | ) |
Definition at line 668 of file fe-exec.c.
References pg_result::memorySize.
| ExecStatusType PQresultStatus | ( | const PGresult * | res | ) |
Definition at line 3427 of file fe-exec.c.
References PGRES_FATAL_ERROR, and pg_result::resultStatus.
| char * pqResultStrdup | ( | PGresult * | res, |
| const char * | str | ||
| ) |
Definition at line 680 of file fe-exec.c.
References pqResultAlloc(), and str.
Referenced by getRowDescriptions(), pqGetErrorNotice3(), PQsetResultAttrs(), and pqSetResultError().
| char * PQresultVerboseErrorMessage | ( | const PGresult * | res, |
| PGVerbosity | verbosity, | ||
| PGContextVisibility | show_context | ||
| ) |
Definition at line 3451 of file fe-exec.c.
References PQExpBufferData::data, initPQExpBuffer(), libpq_gettext, PGRES_FATAL_ERROR, PGRES_NONFATAL_ERROR, pqBuildErrorMessage3(), PQExpBufferDataBroken, pg_result::resultStatus, and termPQExpBuffer().
Referenced by exec_command_errverbose().
| int pqRowProcessor | ( | PGconn * | conn, |
| const char ** | errmsgp | ||
| ) |
Definition at line 1222 of file fe-exec.c.
References pg_conn::asyncStatus, pg_result::attDescs, conn, pgresAttDesc::format, i, pgresAttValue::len, pgDataValue::len, pg_conn::maxChunkSize, pg_result::ntups, pg_result::null_field, NULL_LEN, pg_result::numAttributes, pg_conn::partialResMode, PG_COPYRES_ATTRS, PG_COPYRES_EVENTS, PG_COPYRES_NOTICEHOOKS, PGASYNC_READY_MORE, PGRES_SINGLE_TUPLE, PGRES_TUPLES_CHUNK, pqAddTuple(), PQcopyResult(), pqResultAlloc(), pg_conn::result, pg_result::resultStatus, pg_conn::rowBuf, pg_conn::saved_result, pg_conn::singleRowMode, val, value, and pgresAttValue::value.
Referenced by getAnotherTuple().
| void pqSaveErrorResult | ( | PGconn * | conn | ) |
Definition at line 808 of file fe-exec.c.
References conn, pg_conn::error_result, and pqClearAsyncResult().
Referenced by getAnotherTuple(), getCopyResult(), getParamDescriptions(), getRowDescriptions(), handleFatalError(), pqFunctionCall3(), pqGetNegotiateProtocolVersion3(), PQgetResult(), pqParseInput3(), pqPipelineProcessQueue(), and pqSaveWriteError().
| void pqSaveMessageField | ( | PGresult * | res, |
| char | code, | ||
| const char * | value | ||
| ) |
Definition at line 1065 of file fe-exec.c.
References pgMessageField::code, pgMessageField::contents, pg_result::errFields, pgMessageField::next, pqResultAlloc(), and value.
Referenced by pqGetErrorNotice3(), and pqInternalNotice().
| int pqSaveParameterStatus | ( | PGconn * | conn, |
| const char * | name, | ||
| const char * | value | ||
| ) |
Definition at line 1090 of file fe-exec.c.
References pg_conn::client_encoding, conn, pg_conn::default_transaction_read_only, free, pg_conn::in_hot_standby, malloc, name, pgParameterStatus::name, pgParameterStatus::next, PG_BOOL_NO, PG_BOOL_YES, pg_char_to_encoding, PG_SQL_ASCII, pg_conn::pstatus, pg_conn::scram_sha_256_iterations, static_client_encoding, static_std_strings, pg_conn::std_strings, pg_conn::sversion, value, and pgParameterStatus::value.
Referenced by getParameterStatus().
|
static |
Definition at line 825 of file fe-exec.c.
References appendPQExpBufferStr(), conn, pg_conn::errorMessage, libpq_append_conn_error(), pqSaveErrorResult(), and pg_conn::write_err_msg.
Referenced by PQgetResult().
| int PQsendClosePortal | ( | PGconn * | conn, |
| const char * | portal | ||
| ) |
Definition at line 2585 of file fe-exec.c.
References conn, PqMsg_Close, and PQsendTypedCommand().
Referenced by test_prepared().
| int PQsendClosePrepared | ( | PGconn * | conn, |
| const char * | stmt | ||
| ) |
Definition at line 2572 of file fe-exec.c.
References conn, PqMsg_Close, PQsendTypedCommand(), and stmt.
Referenced by ExecQueryAndProcessResults(), and test_prepared().
| int PQsendDescribePortal | ( | PGconn * | conn, |
| const char * | portal | ||
| ) |
Definition at line 2520 of file fe-exec.c.
References conn, PqMsg_Describe, and PQsendTypedCommand().
Referenced by test_prepared().
| int PQsendDescribePrepared | ( | PGconn * | conn, |
| const char * | stmt | ||
| ) |
Definition at line 2507 of file fe-exec.c.
References conn, PqMsg_Describe, PQsendTypedCommand(), and stmt.
Referenced by test_prepared().
| int PQsendFlushRequest | ( | PGconn * | conn | ) |
Definition at line 3387 of file fe-exec.c.
References pg_conn::asyncStatus, conn, CONNECTION_OK, libpq_append_conn_error(), PGASYNC_IDLE, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, PqMsg_Flush, pqPipelineFlush(), pqPutMsgEnd(), pqPutMsgStart(), and pg_conn::status.
Referenced by ExecQueryAndProcessResults(), test_nosync(), test_pipeline_idle(), test_singlerowmode(), and test_uniqviol().
| int PQsendPipelineSync | ( | PGconn * | conn | ) |
Definition at line 3298 of file fe-exec.c.
References conn, and pqPipelineSyncInternal().
Referenced by ExecQueryAndProcessResults(), executeMetaCommand(), and test_multi_pipelines().
| int PQsendPrepare | ( | PGconn * | conn, |
| const char * | stmtName, | ||
| const char * | query, | ||
| int | nParams, | ||
| const Oid * | paramTypes | ||
| ) |
Definition at line 1552 of file fe-exec.c.
References conn, i, libpq_append_conn_error(), PGQUERY_PREPARE, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, PQ_QUERY_PARAM_MAX_LIMIT, pqAllocCmdQueueEntry(), pqAppendCmdQueueEntry(), PqMsg_Parse, PqMsg_Sync, pqPipelineFlush(), pqPutInt(), pqPutMsgEnd(), pqPutMsgStart(), pqPuts(), pqRecycleCmdQueueEntry(), PQsendQueryStart(), PGcmdQueueEntry::query, and PGcmdQueueEntry::queryclass.
Referenced by ExecQueryAndProcessResults(), PQprepare(), prepare_foreign_modify(), test_pipelined_insert(), test_prepared(), and test_transaction().
| int PQsendQuery | ( | PGconn * | conn, |
| const char * | query | ||
| ) |
Definition at line 1432 of file fe-exec.c.
References conn, and PQsendQueryInternal().
Referenced by advanceConnectionState(), BaseBackup(), dblink_send_query(), do_sql_command_begin(), ExecQueryAndProcessResults(), fetch_more_data_begin(), libpqsrv_exec(), pgfdw_exec_cleanup_query_begin(), pgfdw_exec_query(), pgfdw_finish_pre_commit_cleanup(), PQexec(), process_slot(), run_command(), run_permutation(), run_reindex_command(), run_vacuum_command(), sendCommand(), storeQueryResult(), and test_disallowed_in_pipeline().
| int PQsendQueryContinue | ( | PGconn * | conn, |
| const char * | query | ||
| ) |
Definition at line 1438 of file fe-exec.c.
References conn, and PQsendQueryInternal().
Referenced by PQconnectPoll().
|
static |
Definition at line 1773 of file fe-exec.c.
References conn, i, libpq_append_conn_error(), PGQUERY_EXTENDED, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, pqAllocCmdQueueEntry(), pqAppendCmdQueueEntry(), PqMsg_Bind, PqMsg_Describe, PqMsg_Execute, PqMsg_Parse, PqMsg_Sync, pqPipelineFlush(), pqPutc(), pqPutInt(), pqPutMsgEnd(), pqPutMsgStart(), pqPutnchar(), pqPuts(), pqRecycleCmdQueueEntry(), PGcmdQueueEntry::query, and PGcmdQueueEntry::queryclass.
Referenced by PQsendQueryParams(), and PQsendQueryPrepared().
|
static |
Definition at line 1444 of file fe-exec.c.
References conn, libpq_append_conn_error(), PGQUERY_SIMPLE, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, pqAllocCmdQueueEntry(), pqAppendCmdQueueEntry(), pqFlush(), PqMsg_Query, pqPutMsgEnd(), pqPutMsgStart(), pqPuts(), pqRecycleCmdQueueEntry(), PQsendQueryStart(), PGcmdQueueEntry::query, and PGcmdQueueEntry::queryclass.
Referenced by PQsendQuery(), and PQsendQueryContinue().
| int PQsendQueryParams | ( | PGconn * | conn, |
| const char * | command, | ||
| int | nParams, | ||
| const Oid * | paramTypes, | ||
| const char *const * | paramValues, | ||
| const int * | paramLengths, | ||
| const int * | paramFormats, | ||
| int | resultFormat | ||
| ) |
Definition at line 1508 of file fe-exec.c.
References conn, libpq_append_conn_error(), PQ_QUERY_PARAM_MAX_LIMIT, PQsendQueryGuts(), and PQsendQueryStart().
Referenced by create_cursor(), ExecQueryAndProcessResults(), execute_dml_stmt(), libpqsrv_exec_params(), PQexecParams(), send_cancellable_query_impl(), sendCommand(), test_multi_pipelines(), test_nosync(), test_pipeline_abort(), test_pipeline_idle(), test_pipelined_insert(), test_simple_pipeline(), test_singlerowmode(), and test_transaction().
| int PQsendQueryPrepared | ( | PGconn * | conn, |
| const char * | stmtName, | ||
| int | nParams, | ||
| const char *const * | paramValues, | ||
| const int * | paramLengths, | ||
| const int * | paramFormats, | ||
| int | resultFormat | ||
| ) |
Definition at line 1649 of file fe-exec.c.
References conn, libpq_append_conn_error(), PQ_QUERY_PARAM_MAX_LIMIT, PQsendQueryGuts(), and PQsendQueryStart().
Referenced by ExecQueryAndProcessResults(), execute_foreign_modify(), PQexecPrepared(), process_queued_fetch_requests(), sendCommand(), test_pipelined_insert(), test_transaction(), and test_uniqviol().
|
static |
Definition at line 1689 of file fe-exec.c.
References pg_conn::asyncStatus, pg_conn::cmd_queue_head, conn, CONNECTION_OK, libpq_append_conn_error(), pg_conn::maxChunkSize, pg_conn::partialResMode, PGASYNC_BUSY, PGASYNC_COPY_BOTH, PGASYNC_COPY_IN, PGASYNC_COPY_OUT, PGASYNC_IDLE, PGASYNC_PIPELINE_IDLE, PGASYNC_READY, PGASYNC_READY_MORE, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, pqClearAsyncResult(), pqClearConnErrorState, pg_conn::singleRowMode, and pg_conn::status.
Referenced by PQsendPrepare(), PQsendQueryInternal(), PQsendQueryParams(), PQsendQueryPrepared(), and PQsendTypedCommand().
|
static |
Definition at line 2605 of file fe-exec.c.
References conn, libpq_append_conn_error(), PGQUERY_CLOSE, PGQUERY_DESCRIBE, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, pqAllocCmdQueueEntry(), pqAppendCmdQueueEntry(), PqMsg_Close, PqMsg_Describe, PqMsg_Sync, pqPipelineFlush(), pqPutc(), pqPutMsgEnd(), pqPutMsgStart(), pqPuts(), pqRecycleCmdQueueEntry(), PQsendQueryStart(), PGcmdQueueEntry::queryclass, and type.
Referenced by PQclosePortal(), PQclosePrepared(), PQdescribePortal(), PQdescribePrepared(), PQsendClosePortal(), PQsendClosePrepared(), PQsendDescribePortal(), and PQsendDescribePrepared().
| int PQsetChunkedRowsMode | ( | PGconn * | conn, |
| int | chunkSize | ||
| ) |
Definition at line 1981 of file fe-exec.c.
References canChangeResultMode(), conn, pg_conn::maxChunkSize, pg_conn::partialResMode, and pg_conn::singleRowMode.
Referenced by ExecQueryAndProcessResults(), and test_singlerowmode().
| int PQsetnonblocking | ( | PGconn * | conn, |
| int | arg | ||
| ) |
Definition at line 3960 of file fe-exec.c.
References arg, pg_conn::cmd_queue_head, conn, CONNECTION_BAD, pg_conn::nonblocking, pqClearConnErrorState, pqFlush(), pg_conn::status, and true.
Referenced by test_cancel(), test_pipelined_insert(), and test_uniqviol().
| int PQsetResultAttrs | ( | PGresult * | res, |
| int | numAttributes, | ||
| PGresAttDesc * | attDescs | ||
| ) |
Definition at line 249 of file fe-exec.c.
References pg_result::attDescs, pg_result::binary, pgresAttDesc::format, i, pgresAttDesc::name, pg_result::null_field, pg_result::numAttributes, OOM_result, PQresultAlloc(), and pqResultStrdup().
Referenced by PQcopyResult().
| void pqSetResultError | ( | PGresult * | res, |
| PQExpBuffer | errorMessage, | ||
| int | offset | ||
| ) |
Definition at line 697 of file fe-exec.c.
References PQExpBufferData::data, pg_result::errMsg, libpq_gettext, PQExpBufferBroken, and pqResultStrdup().
Referenced by pqGetErrorNotice3(), PQmakeEmptyPGresult(), and pqPrepareAsyncResult().
| int PQsetSingleRowMode | ( | PGconn * | conn | ) |
Definition at line 1964 of file fe-exec.c.
References canChangeResultMode(), conn, pg_conn::maxChunkSize, pg_conn::partialResMode, and pg_conn::singleRowMode.
Referenced by process_queued_fetch_requests(), storeQueryResult(), test_pipeline_abort(), and test_singlerowmode().
| int PQsetvalue | ( | PGresult * | res, |
| int | tup_num, | ||
| int | field_num, | ||
| char * | value, | ||
| int | len | ||
| ) |
Definition at line 452 of file fe-exec.c.
References check_field_number(), errmsg(), i, pgresAttValue::len, len, libpq_gettext, pg_result::noticeHooks, pg_result::ntups, pg_result::null_field, NULL_LEN, pg_result::numAttributes, OOM_result, pqAddTuple(), pqInternalNotice(), pqResultAlloc(), pg_result::tuples, value, and pgresAttValue::value.
Referenced by PQcopyResult().
| unsigned char * PQunescapeBytea | ( | const unsigned char * | strtext, |
| size_t * | retbuflen | ||
| ) |
Definition at line 4637 of file fe-exec.c.
References free, get_hex(), i, ISFIRSTOCTDIGIT, ISOCTDIGIT, j, malloc, OCTVAL, realloc, and tmpbuf.
|
static |
Definition at line 4433 of file fe-exec.c.
Referenced by get_hex().
|
static |
Definition at line 4431 of file fe-exec.c.
Referenced by PQescapeByteaInternal().
|
static |
Definition at line 49 of file fe-exec.c.
Referenced by PQclear(), pqPrepareAsyncResult(), PQresultAlloc(), PQsetResultAttrs(), and PQsetvalue().
| char* const pgresStatus[] |
Definition at line 32 of file fe-exec.c.
Referenced by PQresStatus().
|
static |
Definition at line 59 of file fe-exec.c.
Referenced by PQescapeString(), and pqSaveParameterStatus().
|
static |
Definition at line 60 of file fe-exec.c.
Referenced by PQescapeBytea(), PQescapeString(), and pqSaveParameterStatus().