31#include <valgrind/valgrind.h>
117#define ERRDETAIL_SIGNAL_SENDER(pid, uid) \
119 errdetail("Signal sent by PID %d, UID %d.", (int) (pid), (int) (uid)))
222 VALGRIND_PRINTF(
"Valgrind detected %u error(s) during execution of \"%s\"\n",
228#define valgrind_report_error_query(query) ((void) 0)
273 if (
inBuf->len > 1 &&
287 if (
inBuf->len > 0 &&
381 errmsg(
"unexpected EOF on client connection with an open transaction")));
467 errmsg(
"invalid frontend message type %d",
qtype)));
629#ifdef DEBUG_NODE_TESTS_ENABLED
638 elog(
WARNING,
"copyObject() failed to produce an equal raw parse tree");
655 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal raw parse tree");
682 const char *query_string,
683 const Oid *paramTypes,
721 const char *query_string,
743 for (
int i = 0;
i < *numParams;
i++)
745 Oid ptype = (*paramTypes)[
i];
750 errmsg(
"could not determine data type of parameter $%d",
775 const char *query_string,
777 void *parserSetupArg,
839#ifdef DEBUG_NODE_TESTS_ENABLED
849 elog(
WARNING,
"copyObject() failed to produce an equal rewritten parse tree");
878 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal rewritten parse tree");
921#ifdef DEBUG_NODE_TESTS_ENABLED
935 elog(
WARNING,
"copyObject() failed to produce an equal plan tree");
958 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal plan tree");
1002 stmt->canSetTag = query->canSetTag;
1005 stmt->stmt_len = query->stmt_len;
1006 stmt->queryId = query->queryId;
1087 (
errmsg(
"statement: %s", query_string),
1154 errmsg(
"current transaction is aborted, "
1155 "commands ignored until end of transaction block")));
1198 "per-parsetree message context",
1384 (
errmsg(
"duration: %s ms statement: %s",
1406 const char *stmt_name,
1434 *stmt_name ? stmt_name :
"<unnamed>",
1471 "unnamed prepared statement",
1490 errmsg(
"cannot insert multiple commands into a prepared statement")));
1510 errmsg(
"current transaction is aborted, "
1511 "commands ignored until end of transaction block")));
1547 raw_parse_tree =
NULL;
1619 (
errmsg(
"duration: %s ms parse %s: %s",
1621 *stmt_name ? stmt_name :
"<unnamed>",
1642 const char *stmt_name;
1669 *stmt_name ? stmt_name :
"<unnamed>")));
1672 if (stmt_name[0] !=
'\0')
1686 errmsg(
"unnamed prepared statement does not exist")));
1696 foreach(
lc,
psrc->query_list)
1738 errmsg(
"bind message has %d parameter formats but %d parameters",
1741 if (numParams !=
psrc->num_params)
1744 errmsg(
"bind message supplies %d parameters, but prepared statement \"%s\" requires %d",
1745 numParams, stmt_name,
psrc->num_params)));
1756 (!(
psrc->raw_parse_tree &&
1761 errmsg(
"current transaction is aborted, "
1762 "commands ignored until end of transaction block")));
1797 if (numParams > 0 ||
1798 (
psrc->raw_parse_tree &&
1827 for (
int paramno = 0; paramno < numParams; paramno++)
1829 Oid ptype =
psrc->param_types[paramno];
1954 if (!isNull &&
pbuf.cursor !=
pbuf.len)
1957 errmsg(
"incorrect binary data format in bind parameter %d",
1964 errmsg(
"unsupported format code: %d",
2096 (
errmsg(
"duration: %s ms bind %s%s%s: %s",
2098 *stmt_name ? stmt_name :
"<unnamed>",
2101 psrc->query_string),
2128 const char *sourceText;
2129 const char *prepStmtName;
2177 prepStmtName =
"<unnamed>";
2246 _(
"execute fetch from") :
2265 errmsg(
"current transaction is aborted, "
2266 "commands ignored until end of transaction block")));
2316 portalParams =
NULL;
2367 (
errmsg(
"duration: %s ms %s %s%s%s: %s",
2370 _(
"execute fetch from") :
2382 ShowUsage(
"EXECUTE MESSAGE STATISTICS");
2539 if (
str &&
str[0] !=
'\0')
2557 errdetail(
"User was holding shared buffer pin for too long.");
2560 errdetail(
"User was holding a relation lock for too long.");
2563 errdetail(
"User was or might have been using tablespace that must be dropped.");
2566 errdetail(
"User query might have needed to see row versions that must be removed.");
2569 errdetail(
"User was using a logical replication slot that must be invalidated.");
2572 errdetail(
"User transaction caused deadlock with recovery.");
2575 errdetail(
"User transaction caused buffer deadlock with recovery.");
2578 errdetail(
"User was connected to a database that must be dropped.");
2597 if (
data->paramno < 0)
2611 if (
data->portalName &&
data->portalName[0] !=
'\0')
2614 errcontext(
"portal \"%s\" parameter $%d = %s",
2618 data->portalName,
data->paramno + 1);
2623 errcontext(
"unnamed portal parameter $%d = %s",
2654 if (stmt_name[0] !=
'\0')
2668 errmsg(
"unnamed prepared statement does not exist")));
2687 errmsg(
"current transaction is aborted, "
2688 "commands ignored until end of transaction block")));
2699 for (
int i = 0;
i <
psrc->num_params;
i++)
2710 if (
psrc->resultDesc)
2763 errmsg(
"current transaction is aborted, "
2764 "commands ignored until end of transaction block")));
2831#ifdef MEMORY_CONTEXT_CHECKING
2837#ifdef SHOW_MEMORY_STATS
2979 errmsg(
"terminating connection because of unexpected SIGQUIT signal")));
2985 errmsg(
"terminating connection because of crash of another server process"),
2986 errdetail(
"The postmaster has commanded this server process to roll back"
2987 " the current transaction and exit, because another"
2988 " server process exited abnormally and possibly corrupted"
2990 errhint(
"In a moment you should be able to reconnect to the"
2991 " database and repeat your command.")));
2997 errmsg(
"terminating connection due to immediate shutdown command")));
3075 errmsg(
"floating-point exception"),
3076 errdetail(
"An invalid floating-point operation was signaled. "
3077 "This probably means an out-of-range result or an "
3078 "invalid operation, such as division by zero.")));
3184 elog(
FATAL,
"unrecognized conflict mode: %d", (
int) reason);
3203 errmsg(
"terminating connection due to conflict with recovery"),
3277 errmsg(
"canceling statement due to conflict with recovery"),
3289 errmsg(
"terminating connection due to conflict with recovery"),
3291 errhint(
"In a moment you should be able to reconnect to the"
3292 " database and repeat your command.")));
3326 if ((pending & (1 << reason)) != 0)
3373 errmsg(
"canceling authentication due to timeout")));
3377 errmsg(
"terminating autovacuum process due to administrator command"),
3382 errmsg(
"terminating logical replication worker due to administrator command"),
3399 errmsg(
"terminating walreceiver process due to administrator command"),
3404 errmsg(
"terminating background worker \"%s\" due to administrator command",
3410 (
errmsg_internal(
"io worker shutting down due to administrator command"),
3418 errmsg(
"terminating connection due to administrator command"),
3450 errmsg(
"connection to client lost")));
3502 errmsg(
"canceling statement due to lock timeout")));
3509 errmsg(
"canceling statement due to statement timeout")));
3516 errmsg(
"canceling autovacuum task")));
3529 errmsg(
"canceling statement due to user request")));
3550 errmsg(
"terminating connection due to idle-in-transaction timeout")));
3563 errmsg(
"terminating connection due to transaction timeout")));
3576 errmsg(
"terminating connection due to idle-session timeout")));
3618 GUC_check_errdetail(
"\"client_connection_check_interval\" must be set to 0 on this platform.");
3655 "\"log_parser_stats\", \"log_planner_stats\", "
3656 "or \"log_executor_stats\" is true.");
3726 *((
int *) *extra) = flags;
3737 int *flags = (
int *) extra;
3783 const char *tmp =
NULL;
3788 tmp =
"enable_seqscan";
3791 tmp =
"enable_indexscan";
3794 tmp =
"enable_indexonlyscan";
3797 tmp =
"enable_bitmapscan";
3800 tmp =
"enable_tidscan";
3803 tmp =
"enable_nestloop";
3806 tmp =
"enable_mergejoin";
3809 tmp =
"enable_hashjoin";
3829 return "log_parser_stats";
3830 else if (
arg[1] ==
'l')
3831 return "log_planner_stats";
3835 return "log_executor_stats";
3877 if (argc > 1 &&
strcmp(argv[1],
"--single") == 0)
3931 errmsg(
"--%s must be first argument",
optctx.optarg)));
3945 errmsg(
"--%s requires a value",
3950 errmsg(
"-c %s requires a value",
4097 errmsg(
"invalid command-line argument for server process: %s", argv[
optctx.optind]),
4102 errmsg(
"%s: invalid command-line argument: %s",
4146 errmsg(
"%s: no database nor user name specified",
4353 errmsg(
"could not generate random cancel key")));
4440 "RowDescriptionContext",
4578 errmsg(
"terminating connection because protocol synchronization was lost")));
4755 errmsg(
"connection ready: setup total=%.3f ms, fork=%.3f ms, authentication=%.3f ms",
4830 const char *query_string;
4854 const char *stmt_name;
4855 const char *query_string;
4870 for (
int i = 0;
i < numParams;
i++)
4876 paramTypes, numParams);
4986 errmsg(
"invalid CLOSE message subtype %d",
5023 errmsg(
"invalid DESCRIBE message subtype %d",
5096 errmsg(
"invalid frontend message type %d",
5117 errmsg(
"fastpath function calls not supported in a replication connection")));
5121 errmsg(
"extended query protocol not supported in a replication connection")));
5173 "!\t%ld.%06ld s user, %ld.%06ld s system, %ld.%06ld s elapsed\n",
5181 "!\t[%ld.%06ld s user, %ld.%06ld s system total]\n",
5183 (
long)
user.tv_usec,
5185 (
long) sys.tv_usec);
5195 "!\t%ld kB max resident size\n",
5205 "!\t%ld/%ld [%ld/%ld] filesystem blocks in/out\n",
5206 r.ru_inblock -
Save_r.ru_inblock,
5208 r.ru_oublock -
Save_r.ru_oublock,
5209 r.ru_inblock, r.ru_oublock);
5211 "!\t%ld/%ld [%ld/%ld] page faults/reclaims, %ld [%ld] swaps\n",
5212 r.ru_majflt -
Save_r.ru_majflt,
5213 r.ru_minflt -
Save_r.ru_minflt,
5214 r.ru_majflt, r.ru_minflt,
5215 r.ru_nswap -
Save_r.ru_nswap,
5218 "!\t%ld [%ld] signals rcvd, %ld/%ld [%ld/%ld] messages rcvd/sent\n",
5219 r.ru_nsignals -
Save_r.ru_nsignals,
5221 r.ru_msgrcv -
Save_r.ru_msgrcv,
5222 r.ru_msgsnd -
Save_r.ru_msgsnd,
5223 r.ru_msgrcv, r.ru_msgsnd);
5225 "!\t%ld/%ld [%ld/%ld] voluntary/involuntary context switches\n",
5226 r.ru_nvcsw -
Save_r.ru_nvcsw,
5227 r.ru_nivcsw -
Save_r.ru_nivcsw,
5228 r.ru_nvcsw, r.ru_nivcsw);
5232 if (
str.data[
str.len - 1] ==
'\n')
5233 str.data[--
str.len] =
'\0';
5267 (
errmsg(
"disconnection: session time: %d:%02d:%02d.%03d "
5268 "user=%s database=%s host=%s%s%s",
5270 port->user_name,
port->database_name,
port->remote_host,
5271 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)