31#include <valgrind/valgrind.h>
118#define ERRDETAIL_SIGNAL_SENDER(pid, uid) \
120 errdetail_log("Signal sent by PID %d, UID %d.", (int) (pid), (int) (uid)))
223 VALGRIND_PRINTF(
"Valgrind detected %u error(s) during execution of \"%s\"\n",
229#define valgrind_report_error_query(query) ((void) 0)
274 if (
inBuf->len > 1 &&
288 if (
inBuf->len > 0 &&
382 errmsg(
"unexpected EOF on client connection with an open transaction")));
468 errmsg(
"invalid frontend message type %d",
qtype)));
630#ifdef DEBUG_NODE_TESTS_ENABLED
639 elog(
WARNING,
"copyObject() failed to produce an equal raw parse tree");
656 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal raw parse tree");
683 const char *query_string,
684 const Oid *paramTypes,
722 const char *query_string,
744 for (
int i = 0;
i < *numParams;
i++)
746 Oid ptype = (*paramTypes)[
i];
751 errmsg(
"could not determine data type of parameter $%d",
776 const char *query_string,
778 void *parserSetupArg,
840#ifdef DEBUG_NODE_TESTS_ENABLED
850 elog(
WARNING,
"copyObject() failed to produce an equal rewritten parse tree");
879 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal rewritten parse tree");
922#ifdef DEBUG_NODE_TESTS_ENABLED
936 elog(
WARNING,
"copyObject() failed to produce an equal plan tree");
959 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal plan tree");
1003 stmt->canSetTag = query->canSetTag;
1006 stmt->stmt_len = query->stmt_len;
1007 stmt->queryId = query->queryId;
1088 (
errmsg(
"statement: %s", query_string),
1155 errmsg(
"current transaction is aborted, "
1156 "commands ignored until end of transaction block")));
1199 "per-parsetree message context",
1385 (
errmsg(
"duration: %s ms statement: %s",
1407 const char *stmt_name,
1435 *stmt_name ? stmt_name :
"<unnamed>",
1472 "unnamed prepared statement",
1491 errmsg(
"cannot insert multiple commands into a prepared statement")));
1511 errmsg(
"current transaction is aborted, "
1512 "commands ignored until end of transaction block")));
1548 raw_parse_tree =
NULL;
1620 (
errmsg(
"duration: %s ms parse %s: %s",
1622 *stmt_name ? stmt_name :
"<unnamed>",
1643 const char *stmt_name;
1670 *stmt_name ? stmt_name :
"<unnamed>")));
1673 if (stmt_name[0] !=
'\0')
1687 errmsg(
"unnamed prepared statement does not exist")));
1697 foreach(
lc,
psrc->query_list)
1739 errmsg(
"bind message has %d parameter formats but %d parameters",
1742 if (numParams !=
psrc->num_params)
1745 errmsg(
"bind message supplies %d parameters, but prepared statement \"%s\" requires %d",
1746 numParams, stmt_name,
psrc->num_params)));
1757 (!(
psrc->raw_parse_tree &&
1762 errmsg(
"current transaction is aborted, "
1763 "commands ignored until end of transaction block")));
1798 if (numParams > 0 ||
1799 (
psrc->raw_parse_tree &&
1828 for (
int paramno = 0; paramno < numParams; paramno++)
1830 Oid ptype =
psrc->param_types[paramno];
1955 if (!isNull &&
pbuf.cursor !=
pbuf.len)
1958 errmsg(
"incorrect binary data format in bind parameter %d",
1965 errmsg(
"unsupported format code: %d",
2097 (
errmsg(
"duration: %s ms bind %s%s%s: %s",
2099 *stmt_name ? stmt_name :
"<unnamed>",
2102 psrc->query_string),
2129 const char *sourceText;
2130 const char *prepStmtName;
2178 prepStmtName =
"<unnamed>";
2247 _(
"execute fetch from") :
2266 errmsg(
"current transaction is aborted, "
2267 "commands ignored until end of transaction block")));
2317 portalParams =
NULL;
2368 (
errmsg(
"duration: %s ms %s %s%s%s: %s",
2371 _(
"execute fetch from") :
2383 ShowUsage(
"EXECUTE MESSAGE STATISTICS");
2540 if (
str &&
str[0] !=
'\0')
2558 errdetail(
"User was holding shared buffer pin for too long.");
2561 errdetail(
"User was holding a relation lock for too long.");
2564 errdetail(
"User was or might have been using tablespace that must be dropped.");
2567 errdetail(
"User query might have needed to see row versions that must be removed.");
2570 errdetail(
"User was using a logical replication slot that must be invalidated.");
2573 errdetail(
"User transaction caused deadlock with recovery.");
2576 errdetail(
"User transaction caused buffer deadlock with recovery.");
2579 errdetail(
"User was connected to a database that must be dropped.");
2598 if (
data->paramno < 0)
2612 if (
data->portalName &&
data->portalName[0] !=
'\0')
2615 errcontext(
"portal \"%s\" parameter $%d = %s",
2619 data->portalName,
data->paramno + 1);
2624 errcontext(
"unnamed portal parameter $%d = %s",
2655 if (stmt_name[0] !=
'\0')
2669 errmsg(
"unnamed prepared statement does not exist")));
2688 errmsg(
"current transaction is aborted, "
2689 "commands ignored until end of transaction block")));
2700 for (
int i = 0;
i <
psrc->num_params;
i++)
2711 if (
psrc->resultDesc)
2764 errmsg(
"current transaction is aborted, "
2765 "commands ignored until end of transaction block")));
2832#ifdef MEMORY_CONTEXT_CHECKING
2838#ifdef SHOW_MEMORY_STATS
2980 errmsg(
"terminating connection because of unexpected SIGQUIT signal")));
2986 errmsg(
"terminating connection because of crash of another server process"),
2987 errdetail(
"The postmaster has commanded this server process to roll back"
2988 " the current transaction and exit, because another"
2989 " server process exited abnormally and possibly corrupted"
2991 errhint(
"In a moment you should be able to reconnect to the"
2992 " database and repeat your command.")));
2998 errmsg(
"terminating connection due to immediate shutdown command")));
3087 errmsg(
"floating-point exception"),
3088 errdetail(
"An invalid floating-point operation was signaled. "
3089 "This probably means an out-of-range result or an "
3090 "invalid operation, such as division by zero.")));
3196 elog(
FATAL,
"unrecognized conflict mode: %d", (
int) reason);
3215 errmsg(
"terminating connection due to conflict with recovery"),
3289 errmsg(
"canceling statement due to conflict with recovery"),
3301 errmsg(
"terminating connection due to conflict with recovery"),
3303 errhint(
"In a moment you should be able to reconnect to the"
3304 " database and repeat your command.")));
3338 if ((pending & (1 << reason)) != 0)
3385 errmsg(
"canceling authentication due to timeout")));
3389 errmsg(
"terminating autovacuum process due to administrator command"),
3394 errmsg(
"terminating logical replication worker due to administrator command"),
3411 errmsg(
"terminating walreceiver process due to administrator command"),
3416 errmsg(
"terminating background worker \"%s\" due to administrator command",
3422 (
errmsg_internal(
"io worker shutting down due to administrator command"),
3430 errmsg(
"terminating connection due to administrator command"),
3462 errmsg(
"connection to client lost")));
3514 errmsg(
"canceling statement due to lock timeout")));
3521 errmsg(
"canceling statement due to statement timeout")));
3528 errmsg(
"canceling autovacuum task")));
3541 errmsg(
"canceling statement due to user request")));
3562 errmsg(
"terminating connection due to idle-in-transaction timeout")));
3575 errmsg(
"terminating connection due to transaction timeout")));
3588 errmsg(
"terminating connection due to idle-session timeout")));
3630 GUC_check_errdetail(
"\"client_connection_check_interval\" must be set to 0 on this platform.");
3667 "\"log_parser_stats\", \"log_planner_stats\", "
3668 "or \"log_executor_stats\" is true.");
3738 *((
int *) *extra) = flags;
3749 int *flags = (
int *) extra;
3795 const char *tmp =
NULL;
3800 tmp =
"enable_seqscan";
3803 tmp =
"enable_indexscan";
3806 tmp =
"enable_indexonlyscan";
3809 tmp =
"enable_bitmapscan";
3812 tmp =
"enable_tidscan";
3815 tmp =
"enable_nestloop";
3818 tmp =
"enable_mergejoin";
3821 tmp =
"enable_hashjoin";
3841 return "log_parser_stats";
3842 else if (
arg[1] ==
'l')
3843 return "log_planner_stats";
3847 return "log_executor_stats";
3889 if (argc > 1 &&
strcmp(argv[1],
"--single") == 0)
3943 errmsg(
"--%s must be first argument",
optctx.optarg)));
3957 errmsg(
"--%s requires a value",
3962 errmsg(
"-c %s requires a value",
4109 errmsg(
"invalid command-line argument for server process: %s", argv[
optctx.optind]),
4114 errmsg(
"%s: invalid command-line argument: %s",
4158 errmsg(
"%s: no database nor user name specified",
4365 errmsg(
"could not generate random cancel key")));
4452 "RowDescriptionContext",
4590 errmsg(
"terminating connection because protocol synchronization was lost")));
4767 errmsg(
"connection ready: setup total=%.3f ms, fork=%.3f ms, authentication=%.3f ms",
4842 const char *query_string;
4866 const char *stmt_name;
4867 const char *query_string;
4882 for (
int i = 0;
i < numParams;
i++)
4888 paramTypes, numParams);
4998 errmsg(
"invalid CLOSE message subtype %d",
5035 errmsg(
"invalid DESCRIBE message subtype %d",
5108 errmsg(
"invalid frontend message type %d",
5129 errmsg(
"fastpath function calls not supported in a replication connection")));
5133 errmsg(
"extended query protocol not supported in a replication connection")));
5185 "!\t%ld.%06ld s user, %ld.%06ld s system, %ld.%06ld s elapsed\n",
5193 "!\t[%ld.%06ld s user, %ld.%06ld s system total]\n",
5195 (
long)
user.tv_usec,
5197 (
long) sys.tv_usec);
5207 "!\t%ld kB max resident size\n",
5217 "!\t%ld/%ld [%ld/%ld] filesystem blocks in/out\n",
5218 r.ru_inblock -
Save_r.ru_inblock,
5220 r.ru_oublock -
Save_r.ru_oublock,
5221 r.ru_inblock, r.ru_oublock);
5223 "!\t%ld/%ld [%ld/%ld] page faults/reclaims, %ld [%ld] swaps\n",
5224 r.ru_majflt -
Save_r.ru_majflt,
5225 r.ru_minflt -
Save_r.ru_minflt,
5226 r.ru_majflt, r.ru_minflt,
5227 r.ru_nswap -
Save_r.ru_nswap,
5230 "!\t%ld [%ld] signals rcvd, %ld/%ld [%ld/%ld] messages rcvd/sent\n",
5231 r.ru_nsignals -
Save_r.ru_nsignals,
5233 r.ru_msgrcv -
Save_r.ru_msgrcv,
5234 r.ru_msgsnd -
Save_r.ru_msgsnd,
5235 r.ru_msgrcv, r.ru_msgsnd);
5237 "!\t%ld/%ld [%ld/%ld] voluntary/involuntary context switches\n",
5238 r.ru_nvcsw -
Save_r.ru_nvcsw,
5239 r.ru_nivcsw -
Save_r.ru_nivcsw,
5240 r.ru_nvcsw, r.ru_nivcsw);
5244 if (
str.data[
str.len - 1] ==
'\n')
5245 str.data[--
str.len] =
'\0';
5279 (
errmsg(
"disconnection: session time: %d:%02d:%02d.%03d "
5280 "user=%s database=%s host=%s%s%s",
5282 port->user_name,
port->database_name,
port->remote_host,
5283 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
static uint32 pg_atomic_fetch_and_u32(volatile pg_atomic_uint32 *ptr, uint32 and_)
static uint32 pg_atomic_fetch_or_u32(volatile pg_atomic_uint32 *ptr, uint32 or_)
static uint32 pg_atomic_read_membarrier_u32(volatile pg_atomic_uint32 *ptr)
static uint32 pg_atomic_read_u32(volatile pg_atomic_uint32 *ptr)
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)
memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets))
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)
void EmitErrorReport(void)
ErrorContextCallback * error_context_stack
void FlushErrorState(void)
int errcode(int sqlerrcode)
sigjmp_buf * PG_exception_stack
int int errhidestmt(bool hide_stmt)
int int errdetail_internal(const char *fmt,...) pg_attribute_printf(1
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define WARNING_CLIENT_ONLY
int int errmsg_internal(const char *fmt,...) pg_attribute_printf(1
#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 ERRCODE_PROTOCOL_VIOLATION
#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 int ProcDieSenderPid
volatile uint32 QueryCancelHoldoffCount
ProtocolVersion FrontendProtocol
volatile sig_atomic_t IdleInTransactionSessionTimeoutPending
volatile uint32 InterruptHoldoffCount
volatile sig_atomic_t TransactionTimeoutPending
volatile int ProcDieSenderUid
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 RegisterBuiltinShmemCallbacks(void)
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 pg_getopt_next(pg_getopt_ctx *ctx)
void pg_getopt_start(pg_getopt_ctx *ctx, int nargc, char *const *nargv, const char *ostr)
#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)
CachedPlanSource * CreateCachedPlan(const RawStmt *raw_parse_tree, const char *query_string, CommandTag commandTag)
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)
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 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 void forbidden_in_wal_sender(char firstchar)
static void exec_execute_message(const char *portal_name, long max_rows)
static void report_recovery_conflict(RecoveryConflictReason reason)
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 ProcessRecoveryConflictInterrupt(RecoveryConflictReason reason)
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)
List * pg_rewrite_query(Query *query)
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
#define ERRDETAIL_SIGNAL_SENDER(pid, uid)
static void exec_bind_message(StringInfo input_message)
static bool DoingCommandRead
static int errdetail_recovery_conflict(RecoveryConflictReason reason)
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 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)
void HandleRecoveryConflictInterrupt(void)
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, uint32 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)
#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)
volatile sig_atomic_t RepackMessagePending
void ProcessRepackMessages(void)
int getrusage(int who, struct rusage *rusage)
List * QueryRewrite(Query *parsetree)
void ShmemCallRequestCallbacks(void)
void ProcessCatchupInterrupt(void)
volatile sig_atomic_t catchupInterruptPending
ReplicationSlot * MyReplicationSlot
void ReplicationSlotRelease(void)
void ReplicationSlotCleanup(bool synced_only)
void ProcessSlotSyncMessage(void)
volatile sig_atomic_t SlotSyncShutdownPending
Snapshot GetTransactionSnapshot(void)
void PushActiveSnapshot(Snapshot snapshot)
bool ActiveSnapshotSet(void)
void InvalidateCatalogSnapshotConditionally(void)
void PopActiveSnapshot(void)
int IdleInTransactionSessionTimeout
void LockErrorCleanup(void)
void CheckDeadLockAlert(void)
@ RECOVERY_CONFLICT_TABLESPACE
@ RECOVERY_CONFLICT_SNAPSHOT
@ RECOVERY_CONFLICT_DATABASE
@ RECOVERY_CONFLICT_STARTUP_DEADLOCK
@ RECOVERY_CONFLICT_BUFFERPIN
@ RECOVERY_CONFLICT_BUFFERPIN_DEADLOCK
@ RECOVERY_CONFLICT_LOGICALSLOT
#define NUM_RECOVERY_CONFLICT_REASONS
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)
pg_atomic_uint32 pendingRecoveryConflicts
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)