31#include <valgrind/valgrind.h>
211 VALGRIND_PRINTF(
"Valgrind detected %u error(s) during execution of \"%s\"\n",
217#define valgrind_report_error_query(query) ((void) 0)
262 if (
inBuf->len > 1 &&
276 if (
inBuf->len > 0 &&
370 errmsg(
"unexpected EOF on client connection with an open transaction")));
456 errmsg(
"invalid frontend message type %d",
qtype)));
618#ifdef DEBUG_NODE_TESTS_ENABLED
627 elog(
WARNING,
"copyObject() failed to produce an equal raw parse tree");
644 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal raw parse tree");
671 const char *query_string,
672 const Oid *paramTypes,
710 const char *query_string,
732 for (
int i = 0;
i < *numParams;
i++)
734 Oid ptype = (*paramTypes)[
i];
739 errmsg(
"could not determine data type of parameter $%d",
764 const char *query_string,
766 void *parserSetupArg,
828#ifdef DEBUG_NODE_TESTS_ENABLED
838 elog(
WARNING,
"copyObject() failed to produce an equal rewritten parse tree");
867 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal rewritten parse tree");
910#ifdef DEBUG_NODE_TESTS_ENABLED
924 elog(
WARNING,
"copyObject() failed to produce an equal plan tree");
947 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal plan tree");
991 stmt->canSetTag = query->canSetTag;
994 stmt->stmt_len = query->stmt_len;
995 stmt->queryId = query->queryId;
1076 (
errmsg(
"statement: %s", query_string),
1143 errmsg(
"current transaction is aborted, "
1144 "commands ignored until end of transaction block"),
1188 "per-parsetree message context",
1374 (
errmsg(
"duration: %s ms statement: %s",
1396 const char *stmt_name,
1424 *stmt_name ? stmt_name :
"<unnamed>",
1461 "unnamed prepared statement",
1480 errmsg(
"cannot insert multiple commands into a prepared statement")));
1500 errmsg(
"current transaction is aborted, "
1501 "commands ignored until end of transaction block"),
1538 raw_parse_tree =
NULL;
1610 (
errmsg(
"duration: %s ms parse %s: %s",
1612 *stmt_name ? stmt_name :
"<unnamed>",
1633 const char *stmt_name;
1660 *stmt_name ? stmt_name :
"<unnamed>")));
1663 if (stmt_name[0] !=
'\0')
1677 errmsg(
"unnamed prepared statement does not exist")));
1687 foreach(
lc,
psrc->query_list)
1729 errmsg(
"bind message has %d parameter formats but %d parameters",
1732 if (numParams !=
psrc->num_params)
1735 errmsg(
"bind message supplies %d parameters, but prepared statement \"%s\" requires %d",
1736 numParams, stmt_name,
psrc->num_params)));
1747 (!(
psrc->raw_parse_tree &&
1752 errmsg(
"current transaction is aborted, "
1753 "commands ignored until end of transaction block"),
1789 if (numParams > 0 ||
1790 (
psrc->raw_parse_tree &&
1819 for (
int paramno = 0; paramno < numParams; paramno++)
1821 Oid ptype =
psrc->param_types[paramno];
1946 if (!isNull &&
pbuf.cursor !=
pbuf.len)
1949 errmsg(
"incorrect binary data format in bind parameter %d",
1956 errmsg(
"unsupported format code: %d",
2088 (
errmsg(
"duration: %s ms bind %s%s%s: %s",
2090 *stmt_name ? stmt_name :
"<unnamed>",
2093 psrc->query_string),
2120 const char *sourceText;
2121 const char *prepStmtName;
2169 prepStmtName =
"<unnamed>";
2238 _(
"execute fetch from") :
2257 errmsg(
"current transaction is aborted, "
2258 "commands ignored until end of transaction block"),
2309 portalParams =
NULL;
2360 (
errmsg(
"duration: %s ms %s %s%s%s: %s",
2363 _(
"execute fetch from") :
2375 ShowUsage(
"EXECUTE MESSAGE STATISTICS");
2532 if (
str &&
str[0] !=
'\0')
2548 errdetail(
"Abort reason: recovery conflict");
2564 errdetail(
"User was holding shared buffer pin for too long.");
2567 errdetail(
"User was holding a relation lock for too long.");
2570 errdetail(
"User was or might have been using tablespace that must be dropped.");
2573 errdetail(
"User query might have needed to see row versions that must be removed.");
2576 errdetail(
"User was using a logical replication slot that must be invalidated.");
2579 errdetail(
"User transaction caused buffer deadlock with recovery.");
2582 errdetail(
"User was connected to a database that must be dropped.");
2604 if (
data->paramno < 0)
2618 if (
data->portalName &&
data->portalName[0] !=
'\0')
2621 errcontext(
"portal \"%s\" parameter $%d = %s",
2625 data->portalName,
data->paramno + 1);
2630 errcontext(
"unnamed portal parameter $%d = %s",
2661 if (stmt_name[0] !=
'\0')
2675 errmsg(
"unnamed prepared statement does not exist")));
2694 errmsg(
"current transaction is aborted, "
2695 "commands ignored until end of transaction block"),
2707 for (
int i = 0;
i <
psrc->num_params;
i++)
2718 if (
psrc->resultDesc)
2771 errmsg(
"current transaction is aborted, "
2772 "commands ignored until end of transaction block"),
2840#ifdef MEMORY_CONTEXT_CHECKING
2846#ifdef SHOW_MEMORY_STATS
2988 errmsg(
"terminating connection because of unexpected SIGQUIT signal")));
2994 errmsg(
"terminating connection because of crash of another server process"),
2995 errdetail(
"The postmaster has commanded this server process to roll back"
2996 " the current transaction and exit, because another"
2997 " server process exited abnormally and possibly corrupted"
2999 errhint(
"In a moment you should be able to reconnect to the"
3000 " database and repeat your command.")));
3006 errmsg(
"terminating connection due to immediate shutdown command")));
3084 errmsg(
"floating-point exception"),
3085 errdetail(
"An invalid floating-point operation was signaled. "
3086 "This probably means an out-of-range result or an "
3087 "invalid operation, such as division by zero.")));
3229 errmsg(
"canceling statement due to conflict with recovery"),
3250 errmsg(
"terminating connection due to conflict with recovery"),
3252 errhint(
"In a moment you should be able to reconnect to the"
3253 " database and repeat your command.")));
3257 elog(
FATAL,
"unrecognized conflict mode: %d", (
int) reason);
3322 errmsg(
"canceling authentication due to timeout")));
3326 errmsg(
"terminating autovacuum process due to administrator command")));
3330 errmsg(
"terminating logical replication worker due to administrator command")));
3345 errmsg(
"terminating walreceiver process due to administrator command")));
3349 errmsg(
"terminating background worker \"%s\" due to administrator command",
3354 (
errmsg_internal(
"io worker shutting down due to administrator command")));
3361 errmsg(
"terminating connection due to administrator command")));
3392 errmsg(
"connection to client lost")));
3444 errmsg(
"canceling statement due to lock timeout")));
3451 errmsg(
"canceling statement due to statement timeout")));
3458 errmsg(
"canceling autovacuum task")));
3471 errmsg(
"canceling statement due to user request")));
3492 errmsg(
"terminating connection due to idle-in-transaction timeout")));
3505 errmsg(
"terminating connection due to transaction timeout")));
3518 errmsg(
"terminating connection due to idle-session timeout")));
3554 GUC_check_errdetail(
"\"client_connection_check_interval\" must be set to 0 on this platform.");
3591 "\"log_parser_stats\", \"log_planner_stats\", "
3592 "or \"log_executor_stats\" is true.");
3662 *((
int *) *extra) = flags;
3673 int *flags = (
int *) extra;
3719 const char *tmp =
NULL;
3724 tmp =
"enable_seqscan";
3727 tmp =
"enable_indexscan";
3730 tmp =
"enable_indexonlyscan";
3733 tmp =
"enable_bitmapscan";
3736 tmp =
"enable_tidscan";
3739 tmp =
"enable_nestloop";
3742 tmp =
"enable_mergejoin";
3745 tmp =
"enable_hashjoin";
3765 return "log_parser_stats";
3766 else if (
optarg[1] ==
'l')
3767 return "log_planner_stats";
3771 return "log_executor_stats";
3812 if (argc > 1 &&
strcmp(argv[1],
"--single") == 0)
3823#ifdef HAVE_INT_OPTERR
3838 while ((
flag =
getopt(argc, argv,
"B:bC:c:D:d:EeFf:h:ijk:lN:nOPp:r:S:sTt:v:W:-:")) != -1)
3881 errmsg(
"--%s requires a value",
3886 errmsg(
"-c %s requires a value",
4033 errmsg(
"invalid command-line argument for server process: %s", argv[
optind]),
4038 errmsg(
"%s: invalid command-line argument: %s",
4048#ifdef HAVE_INT_OPTRESET
4091 errmsg(
"%s: no database nor user name specified",
4284 errmsg(
"could not generate random cancel key")));
4371 "RowDescriptionContext",
4509 errmsg(
"terminating connection because protocol synchronization was lost")));
4686 errmsg(
"connection ready: setup total=%.3f ms, fork=%.3f ms, authentication=%.3f ms",
4761 const char *query_string;
4785 const char *stmt_name;
4786 const char *query_string;
4801 for (
int i = 0;
i < numParams;
i++)
4807 paramTypes, numParams);
4917 errmsg(
"invalid CLOSE message subtype %d",
4954 errmsg(
"invalid DESCRIBE message subtype %d",
5027 errmsg(
"invalid frontend message type %d",
5048 errmsg(
"fastpath function calls not supported in a replication connection")));
5052 errmsg(
"extended query protocol not supported in a replication connection")));
5104 "!\t%ld.%06ld s user, %ld.%06ld s system, %ld.%06ld s elapsed\n",
5112 "!\t[%ld.%06ld s user, %ld.%06ld s system total]\n",
5114 (
long)
user.tv_usec,
5116 (
long) sys.tv_usec);
5126 "!\t%ld kB max resident size\n",
5136 "!\t%ld/%ld [%ld/%ld] filesystem blocks in/out\n",
5137 r.ru_inblock -
Save_r.ru_inblock,
5139 r.ru_oublock -
Save_r.ru_oublock,
5140 r.ru_inblock, r.ru_oublock);
5142 "!\t%ld/%ld [%ld/%ld] page faults/reclaims, %ld [%ld] swaps\n",
5143 r.ru_majflt -
Save_r.ru_majflt,
5144 r.ru_minflt -
Save_r.ru_minflt,
5145 r.ru_majflt, r.ru_minflt,
5146 r.ru_nswap -
Save_r.ru_nswap,
5149 "!\t%ld [%ld] signals rcvd, %ld/%ld [%ld/%ld] messages rcvd/sent\n",
5150 r.ru_nsignals -
Save_r.ru_nsignals,
5152 r.ru_msgrcv -
Save_r.ru_msgrcv,
5153 r.ru_msgsnd -
Save_r.ru_msgsnd,
5154 r.ru_msgrcv, r.ru_msgsnd);
5156 "!\t%ld/%ld [%ld/%ld] voluntary/involuntary context switches\n",
5157 r.ru_nvcsw -
Save_r.ru_nvcsw,
5158 r.ru_nivcsw -
Save_r.ru_nivcsw,
5159 r.ru_nvcsw, r.ru_nivcsw);
5163 if (
str.data[
str.len - 1] ==
'\n')
5164 str.data[--
str.len] =
'\0';
5198 (
errmsg(
"disconnection: session time: %d:%02d:%02d.%03d "
5199 "user=%s database=%s host=%s%s%s",
5201 port->user_name,
port->database_name,
port->remote_host,
5202 port->remote_port[0] ?
" port=" :
"",
port->remote_port)));
Datum querytree(PG_FUNCTION_ARGS)
volatile sig_atomic_t ParallelApplyMessagePending
void ProcessParallelApplyMessages(void)
void ProcessNotifyInterrupt(bool flush)
volatile sig_atomic_t notifyInterruptPending
void ProcessParallelMessages(void)
volatile sig_atomic_t ParallelMessagePending
void DropPreparedStatement(const char *stmt_name, bool showError)
PreparedStatement * FetchPreparedStatement(const char *stmt_name, bool throwError)
void StorePreparedStatement(const char *stmt_name, CachedPlanSource *plansource, bool from_sql)
void elog_node_display(int lev, const char *title, const void *obj, bool pretty)
List * raw_parser(const char *str, RawParseMode mode)
bool IsLogicalWorker(void)
void TimestampDifference(TimestampTz start_time, TimestampTz stop_time, long *secs, int *microsecs)
TimestampTz GetCurrentTimestamp(void)
ConnectionTiming conn_timing
@ LOG_CONNECTION_SETUP_DURATIONS
void pgstat_report_query_id(int64 query_id, bool force)
void pgstat_report_activity(BackendState state, const char *cmd_str)
void pgstat_report_plan_id(int64 plan_id, bool force)
@ STATE_IDLEINTRANSACTION_ABORTED
@ STATE_IDLEINTRANSACTION
bool HoldingBufferPinThatDelaysRecovery(void)
#define unconstify(underlying_type, expr)
#define Assert(condition)
const char * GetCommandTagNameAndLen(CommandTag commandTag, Size *len)
#define TIMESTAMP_MINUS_INFINITY
void EndCommand(const QueryCompletion *qc, CommandDest dest, bool force_undecorated_output)
DestReceiver * CreateDestReceiver(CommandDest dest)
void BeginCommand(CommandTag commandTag, CommandDest dest)
void ReadyForQuery(CommandDest dest)
void NullCommand(CommandDest dest)
int errmsg_internal(const char *fmt,...)
int errhidestmt(bool hide_stmt)
void EmitErrorReport(void)
int errdetail_internal(const char *fmt,...)
int errdetail(const char *fmt,...)
ErrorContextCallback * error_context_stack
void FlushErrorState(void)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
sigjmp_buf * PG_exception_stack
#define WARNING_CLIENT_ONLY
#define ereport(elevel,...)
bool equal(const void *a, const void *b)
void EventTriggerOnLogin(void)
void HandleFunctionRequest(StringInfo msgBuf)
void set_max_safe_fds(void)
#define palloc_array(type, count)
#define palloc0_array(type, count)
Datum OidReceiveFunctionCall(Oid functionId, StringInfo buf, Oid typioparam, int32 typmod)
Datum OidInputFunctionCall(Oid functionId, char *str, Oid typioparam, int32 typmod)
volatile sig_atomic_t IdleStatsUpdateTimeoutPending
volatile sig_atomic_t LogMemoryContextPending
volatile sig_atomic_t ProcSignalBarrierPending
volatile sig_atomic_t InterruptPending
volatile sig_atomic_t IdleSessionTimeoutPending
volatile uint32 QueryCancelHoldoffCount
ProtocolVersion FrontendProtocol
volatile sig_atomic_t IdleInTransactionSessionTimeoutPending
volatile uint32 InterruptHoldoffCount
volatile sig_atomic_t TransactionTimeoutPending
volatile sig_atomic_t ClientConnectionLost
volatile uint32 CritSectionCount
volatile sig_atomic_t QueryCancelPending
uint8 MyCancelKey[MAX_CANCEL_KEY_LENGTH]
TimestampTz MyStartTimestamp
char OutputFileName[MAXPGPATH]
volatile sig_atomic_t ProcDiePending
volatile sig_atomic_t CheckClientConnectionPending
void ProcessConfigFile(GucContext context)
void BeginReportingGUCOptions(void)
void SetConfigOption(const char *name, const char *value, GucContext context, GucSource source)
void * guc_malloc(int elevel, size_t size)
bool SelectConfigFiles(const char *userDoption, const char *progname)
void ParseLongOption(const char *string, char **name, char **value)
void InitializeGUCOptions(void)
void ReportChangedGUCOptions(void)
#define GUC_check_errdetail
bool Debug_print_raw_parse
int log_parameter_max_length_on_error
int log_min_duration_statement
int log_min_duration_sample
bool Debug_print_rewritten
int log_parameter_max_length
double log_statement_sample_rate
#define INJECTION_POINT(name, arg)
volatile sig_atomic_t ConfigReloadPending
void SignalHandlerForConfigReload(SIGNAL_ARGS)
void on_proc_exit(pg_on_exit_callback function, Datum arg)
bool proc_exit_inprogress
void InitializeShmemGUCs(void)
void CreateSharedMemoryAndSemaphores(void)
void jit_reset_after_error(void)
void SetLatch(Latch *latch)
bool IsLogicalLauncher(void)
#define PQ_SMALL_MESSAGE_LIMIT
#define PQ_LARGE_MESSAGE_LIMIT
List * lappend(List *list, void *datum)
static List * new_list(NodeTag type, int min_size)
void list_free(List *list)
LOCALLOCK * GetAwaitedLock(void)
void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam)
void getTypeBinaryInputInfo(Oid type, Oid *typReceive, Oid *typIOParam)
DispatchOption parse_dispatch_option(const char *name)
char * pg_client_to_server(const char *s, int len)
MemoryContext MessageContext
void MemoryContextReset(MemoryContext context)
char * pstrdup(const char *in)
void MemoryContextSetParent(MemoryContext context, MemoryContext new_parent)
void pfree(void *pointer)
MemoryContext TopMemoryContext
char * pnstrdup(const char *in, Size len)
void MemoryContextStats(MemoryContext context)
MemoryContext PostmasterContext
void ProcessLogMemoryContextInterrupt(void)
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define RESUME_INTERRUPTS()
#define IsExternalConnectionBackend(backend_type)
#define GetProcessingMode()
#define HOLD_CANCEL_INTERRUPTS()
#define INIT_PG_LOAD_SESSION_LIBS
#define AmAutoVacuumWorkerProcess()
#define RESUME_CANCEL_INTERRUPTS()
#define AmBackgroundWorkerProcess()
#define CHECK_FOR_INTERRUPTS()
#define HOLD_INTERRUPTS()
#define SetProcessingMode(mode)
#define AmWalReceiverProcess()
#define AmIoWorkerProcess()
void ChangeToDataDir(void)
void process_shmem_requests(void)
void InitStandaloneProcess(const char *argv0)
void process_shared_preload_libraries(void)
BackendType MyBackendType
void CreateDataDirLockFile(bool amPostmaster)
#define IsA(nodeptr, _type_)
char * nodeToStringWithLocations(const void *obj)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
ParamListInfo makeParamList(int numParams)
char * BuildParamLogString(ParamListInfo params, char **knownTextValues, int maxlen)
void ParamsErrorCallback(void *arg)
void(* ParserSetupHook)(ParseState *pstate, void *arg)
#define CURSOR_OPT_PARALLEL_OK
#define CURSOR_OPT_BINARY
Query * parse_analyze_withcb(RawStmt *parseTree, const char *sourceText, ParserSetupHook parserSetup, void *parserSetupArg, QueryEnvironment *queryEnv)
bool analyze_requires_snapshot(RawStmt *parseTree)
Query * parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
Query * parse_analyze_varparams(RawStmt *parseTree, const char *sourceText, Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv)
int getopt(int nargc, char *const *nargv, const char *ostr)
PGDLLIMPORT char * optarg
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define linitial_node(type, l)
static ListCell * lnext(const List *l, const ListCell *c)
double pg_prng_double(pg_prng_state *state)
pg_prng_state pg_global_prng_state
static rewind_source * source
static char buf[DEFAULT_XLOG_SEG_SIZE]
#define MAX_MULTIBYTE_CHAR_LEN
#define ERRCODE_T_R_SERIALIZATION_FAILURE
long pgstat_report_stat(bool force)
void pgstat_report_connect(Oid dboid)
void pgstat_report_recovery_conflict(int reason)
SessionEndType pgStatSessionEndCause
void DropCachedPlan(CachedPlanSource *plansource)
void SaveCachedPlan(CachedPlanSource *plansource)
void CompleteCachedPlan(CachedPlanSource *plansource, List *querytree_list, MemoryContext querytree_context, Oid *param_types, int num_params, ParserSetupHook parserSetup, void *parserSetupArg, int cursor_options, bool fixed_result)
CachedPlan * GetCachedPlan(CachedPlanSource *plansource, ParamListInfo boundParams, ResourceOwner owner, QueryEnvironment *queryEnv)
CachedPlanSource * CreateCachedPlan(RawStmt *raw_parse_tree, const char *query_string, CommandTag commandTag)
List * CachedPlanGetTargetList(CachedPlanSource *plansource, QueryEnvironment *queryEnv)
PlannedStmt * planner(Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams, ExplainState *es)
void InitPostmasterChildSlots(void)
QuitSignalReason GetQuitSignalReason(void)
bool pg_strong_random(void *buf, size_t len)
int pg_strcasecmp(const char *s1, const char *s2)
size_t strlcpy(char *dst, const char *src, size_t siz)
void PortalDrop(Portal portal, bool isTopCommit)
Portal GetPortalByName(const char *name)
void PortalDefineQuery(Portal portal, const char *prepStmtName, const char *sourceText, CommandTag commandTag, List *stmts, CachedPlan *cplan)
Portal CreatePortal(const char *name, bool allowDup, bool dupSilent)
void PortalErrorCleanup(void)
static int errdetail_recovery_conflict(ProcSignalReason reason)
static void disable_statement_timeout(void)
static bool IsTransactionStmtList(List *pstmts)
List * pg_analyze_and_rewrite_withcb(RawStmt *parsetree, const char *query_string, ParserSetupHook parserSetup, void *parserSetupArg, QueryEnvironment *queryEnv)
void assign_transaction_timeout(int newval, void *extra)
List * pg_parse_query(const char *query_string)
static bool check_log_statement(List *stmt_list)
static void exec_describe_statement_message(const char *stmt_name)
void assign_restrict_nonsystem_relation_kind(const char *newval, void *extra)
void process_postgres_switches(int argc, char *argv[], GucContext ctx, const char **dbname)
PlannedStmt * pg_plan_query(Query *querytree, const char *query_string, int cursorOptions, ParamListInfo boundParams, ExplainState *es)
void quickdie(SIGNAL_ARGS)
static bool IsTransactionExitStmtList(List *pstmts)
static void log_disconnections(int code, Datum arg)
static int errdetail_abort(void)
static void forbidden_in_wal_sender(char firstchar)
static void exec_execute_message(const char *portal_name, long max_rows)
void PostgresSingleUserMain(int argc, char *argv[], const char *username)
List * pg_plan_queries(List *querytrees, const char *query_string, int cursorOptions, ParamListInfo boundParams)
void set_debug_options(int debug_flag, GucContext context, GucSource source)
static bool UseSemiNewlineNewline
static CachedPlanSource * unnamed_stmt_psrc
void FloatExceptionHandler(SIGNAL_ARGS)
int client_connection_check_interval
bool check_log_stats(bool *newval, void **extra, GucSource source)
void StatementCancelHandler(SIGNAL_ARGS)
CommandDest whereToSendOutput
static bool ignore_till_sync
static void finish_xact_command(void)
bool set_plan_disabling_options(const char *arg, GucContext context, GucSource source)
static void enable_statement_timeout(void)
List * pg_analyze_and_rewrite_fixedparams(RawStmt *parsetree, const char *query_string, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
int check_log_duration(char *msec_str, bool was_logged)
static struct timeval Save_t
const char * debug_query_string
static void exec_simple_query(const char *query_string)
const char * get_stats_option_name(const char *arg)
void HandleRecoveryConflictInterrupt(ProcSignalReason reason)
List * pg_rewrite_query(Query *query)
static volatile sig_atomic_t RecoveryConflictPendingReasons[NUM_PROCSIGNALS]
static int errdetail_execute(List *raw_parsetree_list)
void ShowUsage(const char *title)
static void exec_parse_message(const char *query_string, const char *stmt_name, Oid *paramTypes, int numParams)
int restrict_nonsystem_relation_kind
static const char * userDoption
static volatile sig_atomic_t RecoveryConflictPending
static void exec_bind_message(StringInfo input_message)
static bool DoingCommandRead
static int interactive_getc(void)
static int errdetail_params(ParamListInfo params)
static void ProcessRecoveryConflictInterrupts(void)
static int SocketBackend(StringInfo inBuf)
void ProcessClientReadInterrupt(bool blocked)
void ProcessInterrupts(void)
static void bind_param_error_callback(void *arg)
static bool IsTransactionExitStmt(Node *parsetree)
void PostgresMain(const char *dbname, const char *username)
static MemoryContext row_description_context
static int InteractiveBackend(StringInfo inBuf)
static void ProcessRecoveryConflictInterrupt(ProcSignalReason reason)
static struct rusage Save_r
bool check_client_connection_check_interval(int *newval, void **extra, GucSource source)
static StringInfoData row_description_buf
void ProcessClientWriteInterrupt(bool blocked)
static bool doing_extended_query_message
static void start_xact_command(void)
bool check_restrict_nonsystem_relation_kind(char **newval, void **extra, GucSource source)
static void exec_describe_portal_message(const char *portal_name)
List * pg_analyze_and_rewrite_varparams(RawStmt *parsetree, const char *query_string, Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv)
static void drop_unnamed_stmt(void)
#define valgrind_report_error_query(query)
static int ReadCommand(StringInfo inBuf)
bool check_stage_log_stats(bool *newval, void **extra, GucSource source)
void InitializeMaxBackends(void)
void InitializeFastPathLocks(void)
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, bits32 flags, char *out_dbname)
bool ClientAuthInProgress
BackgroundWorker * MyBgworkerEntry
int pq_getmessage(StringInfo s, int maxlen)
bool pq_is_reading_msg(void)
bool pq_check_connection(void)
void pq_startmsgread(void)
#define PG_PROTOCOL(m, n)
void PortalSetResultFormat(Portal portal, int nFormats, int16 *formats)
void PortalStart(Portal portal, ParamListInfo params, int eflags, Snapshot snapshot)
List * FetchPortalTargetList(Portal portal)
bool PortalRun(Portal portal, long count, bool isTopLevel, DestReceiver *dest, DestReceiver *altdest, QueryCompletion *qc)
void SetRemoteDestReceiverParams(DestReceiver *self, Portal portal)
void SendRowDescriptionMessage(StringInfo buf, TupleDesc typeinfo, List *targetlist, int16 *formats)
void ProcessProcSignalBarrier(void)
void procsignal_sigusr1_handler(SIGNAL_ARGS)
@ PROCSIG_RECOVERY_CONFLICT_BUFFERPIN
@ PROCSIG_RECOVERY_CONFLICT_LOCK
@ PROCSIG_RECOVERY_CONFLICT_LOGICALSLOT
@ PROCSIG_RECOVERY_CONFLICT_DATABASE
@ PROCSIG_RECOVERY_CONFLICT_SNAPSHOT
@ PROCSIG_RECOVERY_CONFLICT_LAST
@ PROCSIG_RECOVERY_CONFLICT_FIRST
@ PROCSIG_RECOVERY_CONFLICT_TABLESPACE
@ PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK
#define MAX_CANCEL_KEY_LENGTH
#define PqMsg_CloseComplete
#define PqMsg_BindComplete
#define PqMsg_ParameterDescription
#define PqMsg_FunctionCall
#define PqMsg_PortalSuspended
#define PqMsg_BackendKeyData
#define PqMsg_ParseComplete
void set_ps_display_with_len(const char *activity, size_t len)
static void set_ps_display(const char *activity)
int getrusage(int who, struct rusage *rusage)
List * QueryRewrite(Query *parsetree)
void ProcessCatchupInterrupt(void)
volatile sig_atomic_t catchupInterruptPending
ReplicationSlot * MyReplicationSlot
void ReplicationSlotRelease(void)
void ReplicationSlotCleanup(bool synced_only)
Snapshot GetTransactionSnapshot(void)
void PushActiveSnapshot(Snapshot snapshot)
bool ActiveSnapshotSet(void)
void InvalidateCatalogSnapshotConditionally(void)
void PopActiveSnapshot(void)
int IdleInTransactionSessionTimeout
int GetStartupBufferPinWaitBufId(void)
void LockErrorCleanup(void)
void CheckDeadLockAlert(void)
void resetStringInfo(StringInfo str)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
static void initReadOnlyStringInfo(StringInfo str, char *data, int len)
void appendStringInfoStringQuoted(StringInfo str, const char *s, int maxlen)
char bgw_type[BGW_MAXLEN]
const char * query_string
TimestampTz ready_for_use
TimestampTz socket_create
struct ErrorContextCallback * previous
void(* callback)(void *arg)
bool recoveryConflictPending
ParamExternData params[FLEXIBLE_ARRAY_MEMBER]
MemoryContext portalContext
ParamListInfo portalParams
const char * prepStmtName
CachedPlanSource * plansource
#define RESTRICT_RELKIND_FOREIGN_TABLE
#define RESTRICT_RELKIND_VIEW
void enable_timeout_after(TimeoutId id, int delay_ms)
bool get_timeout_active(TimeoutId id)
void disable_all_timeouts(bool keep_indicators)
TimestampTz get_timeout_finish_time(TimeoutId id)
void InitializeTimeouts(void)
void disable_timeout(TimeoutId id, bool keep_indicator)
bool get_timeout_indicator(TimeoutId id, bool reset_indicator)
@ IDLE_IN_TRANSACTION_SESSION_TIMEOUT
@ IDLE_STATS_UPDATE_TIMEOUT
@ CLIENT_CONNECTION_CHECK_TIMEOUT
CommandTag CreateCommandTag(Node *parsetree)
LogStmtLevel GetCommandLogLevel(Node *parsetree)
static uint64 TimestampDifferenceMicroseconds(TimestampTz start_time, TimestampTz stop_time)
bool SplitIdentifierString(char *rawstring, char separator, List **namelist)
bool WaitEventSetCanReportClosed(void)
void WalSndErrorCleanup(void)
bool exec_replication_command(const char *cmd_string)
int gettimeofday(struct timeval *tp, void *tzp)
bool IsTransactionOrTransactionBlock(void)
void BeginImplicitTransactionBlock(void)
bool IsTransactionState(void)
void CommandCounterIncrement(void)
void StartTransactionCommand(void)
bool IsAbortedTransactionBlockState(void)
void EndImplicitTransactionBlock(void)
bool IsSubTransaction(void)
void SetCurrentStatementStartTimestamp(void)
TimestampTz GetCurrentStatementStartTimestamp(void)
void CommitTransactionCommand(void)
void AbortCurrentTransaction(void)
#define XACT_FLAGS_PIPELINING
#define XACT_FLAGS_NEEDIMMEDIATECOMMIT
void InitializeWalConsistencyChecking(void)
void LocalProcessControlFile(bool reset)