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)))
224 VALGRIND_PRINTF(
"Valgrind detected %u error(s) during execution of \"%s\"\n",
230#define valgrind_report_error_query(query) ((void) 0)
275 if (
inBuf->len > 1 &&
289 if (
inBuf->len > 0 &&
383 errmsg(
"unexpected EOF on client connection with an open transaction")));
469 errmsg(
"invalid frontend message type %d",
qtype)));
631#ifdef DEBUG_NODE_TESTS_ENABLED
640 elog(
WARNING,
"copyObject() failed to produce an equal raw parse tree");
657 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal raw parse tree");
684 const char *query_string,
685 const Oid *paramTypes,
723 const char *query_string,
745 for (
int i = 0;
i < *numParams;
i++)
747 Oid ptype = (*paramTypes)[
i];
752 errmsg(
"could not determine data type of parameter $%d",
777 const char *query_string,
779 void *parserSetupArg,
841#ifdef DEBUG_NODE_TESTS_ENABLED
851 elog(
WARNING,
"copyObject() failed to produce an equal rewritten parse tree");
880 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal rewritten parse tree");
923#ifdef DEBUG_NODE_TESTS_ENABLED
937 elog(
WARNING,
"copyObject() failed to produce an equal plan tree");
960 elog(
WARNING,
"outfuncs/readfuncs failed to produce an equal plan tree");
1004 stmt->canSetTag = query->canSetTag;
1007 stmt->stmt_len = query->stmt_len;
1008 stmt->queryId = query->queryId;
1162 errmsg(
"current transaction is aborted, "
1163 "commands ignored until end of transaction block")));
1206 "per-parsetree message context",
1395 (
errmsg(
"duration: %s ms statement: %s",
1422 const char *stmt_name,
1450 *stmt_name ? stmt_name :
"<unnamed>",
1487 "unnamed prepared statement",
1506 errmsg(
"cannot insert multiple commands into a prepared statement")));
1526 errmsg(
"current transaction is aborted, "
1527 "commands ignored until end of transaction block")));
1563 raw_parse_tree =
NULL;
1638 (
errmsg(
"duration: %s ms parse %s: %s",
1640 *stmt_name ? stmt_name :
"<unnamed>",
1665 const char *stmt_name;
1692 *stmt_name ? stmt_name :
"<unnamed>")));
1695 if (stmt_name[0] !=
'\0')
1709 errmsg(
"unnamed prepared statement does not exist")));
1719 foreach(
lc,
psrc->query_list)
1761 errmsg(
"bind message has %d parameter formats but %d parameters",
1764 if (numParams !=
psrc->num_params)
1767 errmsg(
"bind message supplies %d parameters, but prepared statement \"%s\" requires %d",
1768 numParams, stmt_name,
psrc->num_params)));
1779 (!(
psrc->raw_parse_tree &&
1784 errmsg(
"current transaction is aborted, "
1785 "commands ignored until end of transaction block")));
1820 if (numParams > 0 ||
1821 (
psrc->raw_parse_tree &&
1850 for (
int paramno = 0; paramno < numParams; paramno++)
1852 Oid ptype =
psrc->param_types[paramno];
1977 if (!isNull &&
pbuf.cursor !=
pbuf.len)
1980 errmsg(
"incorrect binary data format in bind parameter %d",
1987 errmsg(
"unsupported format code: %d",
2122 (
errmsg(
"duration: %s ms bind %s%s%s: %s",
2124 *stmt_name ? stmt_name :
"<unnamed>",
2158 const char *sourceText;
2159 const char *prepStmtName;
2207 prepStmtName =
"<unnamed>";
2278 _(
"execute fetch from") :
2300 errmsg(
"current transaction is aborted, "
2301 "commands ignored until end of transaction block")));
2351 portalParams =
NULL;
2405 (
errmsg(
"duration: %s ms %s %s%s%s: %s",
2408 _(
"execute fetch from") :
2424 ShowUsage(
"EXECUTE MESSAGE STATISTICS");
2630 if (
str &&
str[0] !=
'\0')
2648 errdetail(
"User was holding shared buffer pin for too long.");
2651 errdetail(
"User was holding a relation lock for too long.");
2654 errdetail(
"User was or might have been using tablespace that must be dropped.");
2657 errdetail(
"User query might have needed to see row versions that must be removed.");
2660 errdetail(
"User was using a logical replication slot that must be invalidated.");
2663 errdetail(
"User transaction caused deadlock with recovery.");
2666 errdetail(
"User transaction caused buffer deadlock with recovery.");
2669 errdetail(
"User was connected to a database that must be dropped.");
2688 if (
data->paramno < 0)
2702 if (
data->portalName &&
data->portalName[0] !=
'\0')
2705 errcontext(
"portal \"%s\" parameter $%d = %s",
2709 data->portalName,
data->paramno + 1);
2714 errcontext(
"unnamed portal parameter $%d = %s",
2745 if (stmt_name[0] !=
'\0')
2759 errmsg(
"unnamed prepared statement does not exist")));
2778 errmsg(
"current transaction is aborted, "
2779 "commands ignored until end of transaction block")));
2790 for (
int i = 0;
i <
psrc->num_params;
i++)
2801 if (
psrc->resultDesc)
2854 errmsg(
"current transaction is aborted, "
2855 "commands ignored until end of transaction block")));
2922#ifdef MEMORY_CONTEXT_CHECKING
2928#ifdef SHOW_MEMORY_STATS
3070 errmsg(
"terminating connection because of unexpected SIGQUIT signal")));
3076 errmsg(
"terminating connection because of crash of another server process"),
3077 errdetail(
"The postmaster has commanded this server process to roll back"
3078 " the current transaction and exit, because another"
3079 " server process exited abnormally and possibly corrupted"
3081 errhint(
"In a moment you should be able to reconnect to the"
3082 " database and repeat your command.")));
3088 errmsg(
"terminating connection due to immediate shutdown command")));
3177 errmsg(
"floating-point exception"),
3178 errdetail(
"An invalid floating-point operation was signaled. "
3179 "This probably means an out-of-range result or an "
3180 "invalid operation, such as division by zero.")));
3286 elog(
FATAL,
"unrecognized conflict mode: %d", (
int) reason);
3305 errmsg(
"terminating connection due to conflict with recovery"),
3379 errmsg(
"canceling statement due to conflict with recovery"),
3391 errmsg(
"terminating connection due to conflict with recovery"),
3393 errhint(
"In a moment you should be able to reconnect to the"
3394 " database and repeat your command.")));
3428 if ((pending & (1 << reason)) != 0)
3475 errmsg(
"canceling authentication due to timeout")));
3479 errmsg(
"terminating autovacuum process due to administrator command"),
3484 errmsg(
"terminating logical replication worker due to administrator command"),
3501 errmsg(
"terminating walreceiver process due to administrator command"),
3506 errmsg(
"terminating background worker \"%s\" due to administrator command",
3512 (
errmsg_internal(
"io worker shutting down due to administrator command"),
3520 errmsg(
"terminating connection due to administrator command"),
3552 errmsg(
"connection to client lost")));
3604 errmsg(
"canceling statement due to lock timeout")));
3611 errmsg(
"canceling statement due to statement timeout")));
3618 errmsg(
"canceling autovacuum task")));
3631 errmsg(
"canceling statement due to user request")));
3652 errmsg(
"terminating connection due to idle-in-transaction timeout")));
3665 errmsg(
"terminating connection due to transaction timeout")));
3678 errmsg(
"terminating connection due to idle-session timeout")));
3720 GUC_check_errdetail(
"\"client_connection_check_interval\" must be set to 0 on this platform.");
3757 "\"log_parser_stats\", \"log_planner_stats\", "
3758 "or \"log_executor_stats\" is true.");
3828 *((
int *) *extra) = flags;
3839 int *flags = (
int *) extra;
3885 const char *tmp =
NULL;
3890 tmp =
"enable_seqscan";
3893 tmp =
"enable_indexscan";
3896 tmp =
"enable_indexonlyscan";
3899 tmp =
"enable_bitmapscan";
3902 tmp =
"enable_tidscan";
3905 tmp =
"enable_nestloop";
3908 tmp =
"enable_mergejoin";
3911 tmp =
"enable_hashjoin";
3931 return "log_parser_stats";
3932 else if (
arg[1] ==
'l')
3933 return "log_planner_stats";
3937 return "log_executor_stats";
3979 if (argc > 1 &&
strcmp(argv[1],
"--single") == 0)
4033 errmsg(
"--%s must be first argument",
optctx.optarg)));
4047 errmsg(
"--%s requires a value",
4052 errmsg(
"-c %s requires a value",
4199 errmsg(
"invalid command-line argument for server process: %s", argv[
optctx.optind]),
4204 errmsg(
"%s: invalid command-line argument: %s",
4248 errmsg(
"%s: no database nor user name specified",
4455 errmsg(
"could not generate random cancel key")));
4542 "RowDescriptionContext",
4680 errmsg(
"terminating connection because protocol synchronization was lost")));
4857 errmsg(
"connection ready: setup total=%.3f ms, fork=%.3f ms, authentication=%.3f ms",
4932 const char *query_string;
4956 const char *stmt_name;
4957 const char *query_string;
4972 for (
int i = 0;
i < numParams;
i++)
4978 paramTypes, numParams);
5088 errmsg(
"invalid CLOSE message subtype %d",
5125 errmsg(
"invalid DESCRIBE message subtype %d",
5198 errmsg(
"invalid frontend message type %d",
5219 errmsg(
"fastpath function calls not supported in a replication connection")));
5223 errmsg(
"extended query protocol not supported in a replication connection")));
5275 "!\t%ld.%06ld s user, %ld.%06ld s system, %ld.%06ld s elapsed\n",
5283 "!\t[%ld.%06ld s user, %ld.%06ld s system total]\n",
5285 (
long)
user.tv_usec,
5287 (
long) sys.tv_usec);
5297 "!\t%ld kB max resident size\n",
5307 "!\t%ld/%ld [%ld/%ld] filesystem blocks in/out\n",
5308 r.ru_inblock -
Save_r.ru_inblock,
5310 r.ru_oublock -
Save_r.ru_oublock,
5311 r.ru_inblock, r.ru_oublock);
5313 "!\t%ld/%ld [%ld/%ld] page faults/reclaims, %ld [%ld] swaps\n",
5314 r.ru_majflt -
Save_r.ru_majflt,
5315 r.ru_minflt -
Save_r.ru_minflt,
5316 r.ru_majflt, r.ru_minflt,
5317 r.ru_nswap -
Save_r.ru_nswap,
5320 "!\t%ld [%ld] signals rcvd, %ld/%ld [%ld/%ld] messages rcvd/sent\n",
5321 r.ru_nsignals -
Save_r.ru_nsignals,
5323 r.ru_msgrcv -
Save_r.ru_msgrcv,
5324 r.ru_msgsnd -
Save_r.ru_msgsnd,
5325 r.ru_msgrcv, r.ru_msgsnd);
5327 "!\t%ld/%ld [%ld/%ld] voluntary/involuntary context switches\n",
5328 r.ru_nvcsw -
Save_r.ru_nvcsw,
5329 r.ru_nivcsw -
Save_r.ru_nivcsw,
5330 r.ru_nvcsw, r.ru_nivcsw);
5334 if (
str.data[
str.len - 1] ==
'\n')
5335 str.data[--
str.len] =
'\0';
5369 (
errmsg(
"disconnection: session time: %d:%02d:%02d.%03d "
5370 "user=%s database=%s host=%s%s%s",
5372 port->user_name,
port->database_name,
port->remote_host,
5373 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_statement_max_length
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)
int pg_mbcliplen(const char *mbstr, int len, int limit)
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 CompleteCachedPlan(CachedPlanSource *plansource, List *querytree_list, MemoryContext querytree_context, const Oid *param_types, int num_params, ParserSetupHook parserSetup, void *parserSetupArg, int cursor_options, bool fixed_result)
void SaveCachedPlan(CachedPlanSource *plansource)
CachedPlanSource * CreateCachedPlan(const RawStmt *raw_parse_tree, const char *query_string, CommandTag commandTag)
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)
static char * truncate_query_log(const char *query)
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)