|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <fcntl.h>#include <limits.h>#include <signal.h>#include <unistd.h>#include <sys/resource.h>#include <sys/socket.h>#include <sys/time.h>#include "access/parallel.h"#include "access/printtup.h"#include "access/xact.h"#include "catalog/pg_type.h"#include "commands/async.h"#include "commands/event_trigger.h"#include "commands/explain_state.h"#include "commands/prepare.h"#include "commands/repack.h"#include "common/pg_prng.h"#include "jit/jit.h"#include "libpq/libpq.h"#include "libpq/pqformat.h"#include "libpq/pqsignal.h"#include "mb/pg_wchar.h"#include "mb/stringinfo_mb.h"#include "miscadmin.h"#include "nodes/print.h"#include "optimizer/optimizer.h"#include "parser/analyze.h"#include "parser/parser.h"#include "pg_trace.h"#include "pgstat.h"#include "port/pg_getopt_ctx.h"#include "postmaster/interrupt.h"#include "postmaster/postmaster.h"#include "replication/logicallauncher.h"#include "replication/logicalworker.h"#include "replication/slotsync.h"#include "replication/slot.h"#include "replication/walsender.h"#include "rewrite/rewriteHandler.h"#include "storage/bufmgr.h"#include "storage/ipc.h"#include "storage/fd.h"#include "storage/pmsignal.h"#include "storage/proc.h"#include "storage/procsignal.h"#include "storage/shmem_internal.h"#include "storage/sinval.h"#include "storage/standby.h"#include "tcop/backend_startup.h"#include "tcop/fastpath.h"#include "tcop/pquery.h"#include "tcop/tcopprot.h"#include "tcop/utility.h"#include "utils/guc_hooks.h"#include "utils/injection_point.h"#include "utils/lsyscache.h"#include "utils/memutils.h"#include "utils/ps_status.h"#include "utils/snapmgr.h"#include "utils/timeout.h"#include "utils/timestamp.h"#include "utils/varlena.h"
Go to the source code of this file.
Data Structures | |
| struct | BindParamCbData |
Macros | |
| #define | ERRDETAIL_SIGNAL_SENDER(pid, uid) |
| #define | valgrind_report_error_query(query) ((void) 0) |
Typedefs | |
| typedef struct BindParamCbData | BindParamCbData |
| #define ERRDETAIL_SIGNAL_SENDER | ( | pid, | |
| uid | |||
| ) |
Definition at line 118 of file postgres.c.
Definition at line 230 of file postgres.c.
Definition at line 3837 of file postgres.c.
References restrict_nonsystem_relation_kind.
Definition at line 3766 of file postgres.c.
References disable_timeout(), enable_timeout_after(), get_timeout_active(), IsTransactionState(), newval, and TRANSACTION_TIMEOUT.
Definition at line 2682 of file postgres.c.
References appendStringInfoStringQuoted(), arg, buf, data, errcontext, fb(), initStringInfo(), log_parameter_max_length_on_error, and pfree().
Referenced by exec_bind_message().
Definition at line 3716 of file postgres.c.
References GUC_check_errdetail, newval, and WaitEventSetCanReportClosed().
Definition at line 2478 of file postgres.c.
References fb(), GetCurrentStatementStartTimestamp(), GetCurrentTimestamp(), log_duration, log_min_duration_sample, log_min_duration_statement, log_statement_sample_rate, pg_global_prng_state, pg_prng_double(), snprintf, TimestampDifference(), and xact_is_sampled.
Referenced by exec_bind_message(), exec_execute_message(), exec_parse_message(), exec_simple_query(), and HandleFunctionRequest().
Definition at line 2439 of file postgres.c.
References fb(), GetCommandLogLevel(), lfirst, log_statement, LOGSTMT_ALL, LOGSTMT_NONE, and stmt.
Referenced by exec_execute_message(), and exec_simple_query().
Definition at line 3751 of file postgres.c.
References GUC_check_errdetail, log_executor_stats, log_parser_stats, log_planner_stats, and newval.
Definition at line 3785 of file postgres.c.
References fb(), GUC_check_errdetail, guc_malloc(), lfirst, list_free(), LOG, newval, pfree(), pg_strcasecmp(), pstrdup(), RESTRICT_RELKIND_FOREIGN_TABLE, RESTRICT_RELKIND_VIEW, and SplitIdentifierString().
Definition at line 3737 of file postgres.c.
References GUC_check_errdetail, log_statement_stats, and newval.
| void die | ( | SIGNAL_ARGS | ) |
Definition at line 3114 of file postgres.c.
References DestRemote, DISCONNECT_KILLED, DoingCommandRead, fb(), InterruptPending, MyLatch, pgStatSessionEndCause, proc_exit_inprogress, ProcDiePending, ProcDieSenderPid, ProcDieSenderUid, ProcessInterrupts(), SetLatch(), and whereToSendOutput.
Definition at line 5406 of file postgres.c.
References disable_timeout(), get_timeout_active(), and STATEMENT_TIMEOUT.
Referenced by exec_execute_message(), exec_simple_query(), and finish_xact_command().
Definition at line 2992 of file postgres.c.
References DropCachedPlan(), fb(), and unnamed_stmt_psrc.
Referenced by exec_parse_message(), exec_simple_query(), and PostgresMain().
Definition at line 5384 of file postgres.c.
References Assert, disable_timeout(), enable_timeout_after(), get_timeout_active(), STATEMENT_TIMEOUT, StatementTimeout, TransactionTimeout, and xact_started.
Referenced by start_xact_command().
Definition at line 2581 of file postgres.c.
References errdetail(), fb(), FetchPreparedStatement(), IsA, lfirst_node, pfree(), PreparedStatement::plansource, CachedPlanSource::query_string, RawStmt::stmt, stmt, and truncate_query_log().
Referenced by exec_simple_query().
|
static |
Definition at line 2623 of file postgres.c.
References BuildParamLogString(), errdetail(), fb(), log_parameter_max_length, ParamListInfoData::numParams, and str.
Referenced by exec_bind_message(), and exec_execute_message().
|
static |
Definition at line 2643 of file postgres.c.
References errdetail(), RECOVERY_CONFLICT_BUFFERPIN, RECOVERY_CONFLICT_BUFFERPIN_DEADLOCK, RECOVERY_CONFLICT_DATABASE, RECOVERY_CONFLICT_LOCK, RECOVERY_CONFLICT_LOGICALSLOT, RECOVERY_CONFLICT_SNAPSHOT, RECOVERY_CONFLICT_STARTUP_DEADLOCK, and RECOVERY_CONFLICT_TABLESPACE.
Referenced by report_recovery_conflict().
|
static |
Definition at line 1662 of file postgres.c.
References analyze_requires_snapshot(), bind_param_error_callback(), BuildParamLogString(), ErrorContextCallback::callback, check_log_duration(), PortalData::commandTag, CreatePortal(), DEBUG2, debug_query_string, DestRemote, ereport, errcode(), ERRCODE_PROTOCOL_VIOLATION, errdetail_params(), errhidestmt(), errmsg, errmsg_internal(), ERROR, error_context_stack, fb(), FetchPreparedStatement(), GetCachedPlan(), GetTransactionSnapshot(), getTypeBinaryInputInfo(), getTypeInputInfo(), i, initReadOnlyStringInfo(), INT64CONST, InvalidSnapshot, IsAbortedTransactionBlockState(), ParamExternData::isnull, IsTransactionExitStmt(), lfirst_node, LOG, log_parameter_max_length_on_error, log_statement_stats, makeParamList(), MAX_MULTIBYTE_CHAR_LEN, MemoryContextSwitchTo(), MessageContext, PortalData::name, OidInputFunctionCall(), OidReceiveFunctionCall(), palloc0_array, palloc_array, PARAM_FLAG_CONST, ParamListInfoData::params, ParamsErrorCallback(), ParamListInfoData::paramValuesStr, ParamExternData::pflags, pfree(), pg_client_to_server(), pgstat_report_activity(), pgstat_report_plan_id(), pgstat_report_query_id(), plan, PreparedStatement::plansource, pnstrdup(), PopActiveSnapshot(), PortalData::portalContext, PortalDefineQuery(), BindParamCbData::portalName, PortalSetResultFormat(), PortalStart(), pq_getmsgbytes(), pq_getmsgend(), pq_getmsgint(), pq_getmsgstring(), pq_putemptymessage(), PqMsg_BindComplete, ErrorContextCallback::previous, pstrdup(), ParamExternData::ptype, PushActiveSnapshot(), ResetUsage(), set_ps_display(), ShowUsage(), start_xact_command(), STATE_RUNNING, CachedPlan::stmt_list, PortalData::stmts, truncate_query_log(), unconstify, unnamed_stmt_psrc, valgrind_report_error_query, ParamExternData::value, and whereToSendOutput.
Referenced by PostgresMain().
Definition at line 2823 of file postgres.c.
References DestRemote, ereport, errcode(), errmsg, ERROR, fb(), FetchPortalTargetList(), PortalData::formats, GetPortalByName(), IsAbortedTransactionBlockState(), MemoryContextSwitchTo(), MessageContext, PortalIsValid, pq_putemptymessage(), PqMsg_NoData, row_description_buf, SendRowDescriptionMessage(), start_xact_command(), PortalData::tupDesc, and whereToSendOutput.
Referenced by PostgresMain().
Definition at line 2731 of file postgres.c.
References Assert, CachedPlanGetTargetList(), DestRemote, ereport, errcode(), errmsg, ERROR, fb(), FetchPreparedStatement(), i, IsAbortedTransactionBlockState(), MemoryContextSwitchTo(), MessageContext, PreparedStatement::plansource, pq_beginmessage_reuse(), pq_endmessage_reuse(), pq_putemptymessage(), pq_sendint16(), pq_sendint32(), PqMsg_NoData, PqMsg_ParameterDescription, row_description_buf, SendRowDescriptionMessage(), start_xact_command(), unnamed_stmt_psrc, and whereToSendOutput.
Referenced by PostgresMain().
Definition at line 2151 of file postgres.c.
References _, Assert, PortalData::atStart, BeginCommand(), ErrorContextCallback::callback, CHECK_FOR_INTERRUPTS, check_log_duration(), check_log_statement(), CommandCounterIncrement(), PortalData::commandTag, CreateDestReceiver(), debug_query_string, DestRemote, DestRemoteExecute, disable_statement_timeout(), EndCommand(), ereport, errcode(), errdetail_params(), errhidestmt(), errmsg, ERROR, error_context_stack, fb(), FETCH_ALL, finish_xact_command(), GetCommandTagNameAndLen(), GetPortalByName(), INT64CONST, IsAbortedTransactionBlockState(), IsTransactionExitStmtList(), IsTransactionStmtList(), lfirst_node, LOG, log_statement_stats, MyXactFlags, PortalData::name, NIL, NullCommand(), ParamsErrorCallback(), pfree(), pgstat_report_activity(), pgstat_report_plan_id(), pgstat_report_query_id(), PortalIsValid, PortalData::portalParams, PortalRun(), pq_putemptymessage(), PqMsg_PortalSuspended, PortalData::prepStmtName, ErrorContextCallback::previous, pstrdup(), ResetUsage(), set_ps_display_with_len(), SetRemoteDestReceiverParams(), ShowUsage(), PortalData::sourceText, start_xact_command(), STATE_RUNNING, stmt, PortalData::stmts, truncate_query_log(), valgrind_report_error_query, whereToSendOutput, XACT_FLAGS_NEEDIMMEDIATECOMMIT, and XACT_FLAGS_PIPELINING.
Referenced by PostgresMain().
|
static |
Definition at line 1421 of file postgres.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, analyze_requires_snapshot(), CHECK_FOR_INTERRUPTS, check_log_duration(), CommandCounterIncrement(), CompleteCachedPlan(), CreateCachedPlan(), CreateCommandTag(), CURSOR_OPT_PARALLEL_OK, DEBUG2, debug_query_string, DestRemote, drop_unnamed_stmt(), ereport, errcode(), errhidestmt(), errmsg, errmsg_internal(), ERROR, fb(), GetTransactionSnapshot(), IsAbortedTransactionBlockState(), IsTransactionExitStmt(), linitial_node, list_length(), LOG, log_statement_stats, MemoryContextSetParent(), MemoryContextSwitchTo(), MessageContext, NIL, pfree(), pg_analyze_and_rewrite_varparams(), pg_parse_query(), pgstat_report_activity(), PopActiveSnapshot(), pq_putemptymessage(), PqMsg_ParseComplete, PushActiveSnapshot(), ResetUsage(), SaveCachedPlan(), set_ps_display(), ShowUsage(), start_xact_command(), STATE_RUNNING, RawStmt::stmt, StorePreparedStatement(), truncate_query_log(), unnamed_stmt_psrc, and whereToSendOutput.
Referenced by PostgresMain().
Definition at line 1030 of file postgres.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, analyze_requires_snapshot(), Assert, BeginCommand(), BeginImplicitTransactionBlock(), CHECK_FOR_INTERRUPTS, check_log_duration(), check_log_statement(), CommandCounterIncrement(), CreateCommandTag(), CreateDestReceiver(), CreatePortal(), CURSOR_OPT_BINARY, CURSOR_OPT_PARALLEL_OK, debug_query_string, DestRemote, disable_statement_timeout(), drop_unnamed_stmt(), EndCommand(), EndImplicitTransactionBlock(), ereport, errcode(), errdetail_execute(), errhidestmt(), errmsg, ERROR, fb(), FETCH_ALL, finish_xact_command(), format, GetCommandTagNameAndLen(), GetPortalByName(), GetTransactionSnapshot(), InvalidSnapshot, IsA, IsAbortedTransactionBlockState(), IsTransactionExitStmt(), lfirst_node, list_length(), lnext(), LOG, log_statement_stats, MemoryContextDelete(), MemoryContextSwitchTo(), MessageContext, MyXactFlags, NullCommand(), pfree(), pg_analyze_and_rewrite_fixedparams(), pg_parse_query(), pg_plan_queries(), pgstat_report_activity(), pgstat_report_plan_id(), pgstat_report_query_id(), PopActiveSnapshot(), PortalDefineQuery(), PortalDrop(), PortalIsValid, PortalRun(), PortalSetResultFormat(), PortalStart(), PushActiveSnapshot(), ResetUsage(), set_ps_display_with_len(), SetRemoteDestReceiverParams(), ShowUsage(), start_xact_command(), STATE_RUNNING, RawStmt::stmt, stmt, truncate_query_log(), PortalData::visible, whereToSendOutput, and XACT_FLAGS_NEEDIMMEDIATECOMMIT.
Referenced by PostgresMain().
Definition at line 2913 of file postgres.c.
References CommitTransactionCommand(), disable_statement_timeout(), fb(), MemoryContextStats(), TopMemoryContext, and xact_started.
Referenced by exec_execute_message(), exec_simple_query(), and PostgresMain().
| void FloatExceptionHandler | ( | SIGNAL_ARGS | ) |
Definition at line 3172 of file postgres.c.
References ereport, errcode(), errdetail(), errmsg, ERROR, and fb().
Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), BackgroundWorkerMain(), plperl_init_interp(), PostgresMain(), and ReplSlotSyncWorkerMain().
Definition at line 5212 of file postgres.c.
References am_walsender, ereport, errcode(), ERRCODE_PROTOCOL_VIOLATION, errmsg, ERROR, fb(), and PqMsg_FunctionCall.
Referenced by PostgresMain().
Definition at line 3925 of file postgres.c.
Referenced by PostmasterMain(), and process_postgres_switches().
Definition at line 3188 of file postgres.c.
References InterruptPending, MyProc, PGPROC::pendingRecoveryConflicts, and pg_atomic_read_u32().
Referenced by procsignal_sigusr1_handler().
Definition at line 338 of file postgres.c.
References CHECK_FOR_INTERRUPTS, fb(), and ProcessClientReadInterrupt().
Referenced by InteractiveBackend().
|
static |
Definition at line 250 of file postgres.c.
References appendStringInfoChar(), EchoQuery, fb(), interactive_getc(), PqMsg_Query, printf, resetStringInfo(), and UseSemiNewlineNewline.
Referenced by ReadCommand().
Definition at line 2945 of file postgres.c.
References IsA, stmt, TRANS_STMT_COMMIT, TRANS_STMT_PREPARE, TRANS_STMT_ROLLBACK, and TRANS_STMT_ROLLBACK_TO.
Referenced by exec_bind_message(), exec_parse_message(), exec_simple_query(), and IsTransactionExitStmtList().
Definition at line 2962 of file postgres.c.
References CMD_UTILITY, PlannedStmt::commandType, fb(), IsTransactionExitStmt(), linitial_node, list_length(), and PlannedStmt::utilityStmt.
Referenced by exec_execute_message().
Definition at line 2977 of file postgres.c.
References CMD_UTILITY, PlannedStmt::commandType, fb(), IsA, linitial_node, list_length(), and PlannedStmt::utilityStmt.
Referenced by exec_execute_message().
Definition at line 5348 of file postgres.c.
References ereport, errmsg, fb(), GetCurrentTimestamp(), LOG, MyProcPort, MyStartTimestamp, port, SECS_PER_HOUR, SECS_PER_MINUTE, and TimestampDifference().
Referenced by PostgresMain().
| List * pg_analyze_and_rewrite_fixedparams | ( | RawStmt * | parsetree, |
| const char * | query_string, | ||
| const Oid * | paramTypes, | ||
| int | numParams, | ||
| QueryEnvironment * | queryEnv | ||
| ) |
Definition at line 683 of file postgres.c.
References fb(), log_parser_stats, parse_analyze_fixedparams(), pg_rewrite_query(), ResetUsage(), and ShowUsage().
Referenced by _SPI_execute_plan(), _SPI_prepare_plan(), BeginCopyTo(), exec_simple_query(), execute_sql_string(), and RevalidateCachedQuery().
| List * pg_analyze_and_rewrite_varparams | ( | RawStmt * | parsetree, |
| const char * | query_string, | ||
| Oid ** | paramTypes, | ||
| int * | numParams, | ||
| QueryEnvironment * | queryEnv | ||
| ) |
Definition at line 722 of file postgres.c.
References ereport, errcode(), errmsg, ERROR, fb(), i, InvalidOid, log_parser_stats, parse_analyze_varparams(), pg_rewrite_query(), ResetUsage(), and ShowUsage().
Referenced by exec_parse_message(), and PrepareQuery().
| List * pg_analyze_and_rewrite_withcb | ( | RawStmt * | parsetree, |
| const char * | query_string, | ||
| ParserSetupHook | parserSetup, | ||
| void * | parserSetupArg, | ||
| QueryEnvironment * | queryEnv | ||
| ) |
Definition at line 776 of file postgres.c.
References fb(), log_parser_stats, parse_analyze_withcb(), pg_rewrite_query(), ResetUsage(), and ShowUsage().
Referenced by _SPI_execute_plan(), _SPI_prepare_plan(), fmgr_sql_validator(), inline_sql_function_in_from(), prepare_next_query(), RevalidateCachedQuery(), and test_inline_in_from_support_func().
Definition at line 617 of file postgres.c.
References copyObject, Debug_pretty_print, Debug_print_raw_parse, elog, elog_node_display(), equal(), fb(), LOG, log_parser_stats, new_list(), nodeToStringWithLocations(), pfree(), RAW_PARSE_DEFAULT, raw_parser(), ResetUsage(), ShowUsage(), str, and WARNING.
Referenced by exec_parse_message(), exec_simple_query(), execute_sql_string(), fmgr_sql_validator(), ImportForeignSchema(), inline_function(), inline_sql_function_in_from(), sql_compile_callback(), and test_inline_in_from_support_func().
| List * pg_plan_queries | ( | List * | querytrees, |
| const char * | query_string, | ||
| int | cursorOptions, | ||
| ParamListInfo | boundParams | ||
| ) |
Definition at line 988 of file postgres.c.
References CMD_UTILITY, Query::commandType, fb(), lappend(), lfirst_node, makeNode, NIL, pg_plan_query(), PLAN_STMT_INTERNAL, stmt, Query::stmt_location, and Query::utilityStmt.
Referenced by BuildCachedPlan(), exec_simple_query(), and execute_sql_string().
| PlannedStmt * pg_plan_query | ( | Query * | querytree, |
| const char * | query_string, | ||
| int | cursorOptions, | ||
| ParamListInfo | boundParams, | ||
| ExplainState * | es | ||
| ) |
Definition at line 900 of file postgres.c.
References ActiveSnapshotSet(), Assert, CMD_UTILITY, copyObject, Debug_pretty_print, Debug_print_plan, elog, elog_node_display(), equal(), fb(), LOG, log_planner_stats, nodeToStringWithLocations(), pfree(), plan, planner(), querytree(), ResetUsage(), ShowUsage(), str, and WARNING.
Referenced by BeginCopyTo(), ExecCreateTableAs(), PerformCursorOpen(), pg_plan_queries(), refresh_matview_datafill(), and standard_ExplainOneQuery().
Definition at line 816 of file postgres.c.
References CMD_UTILITY, Query::commandType, copyObject, Debug_pretty_print, Debug_print_parse, Debug_print_rewritten, elog, elog_node_display(), equal(), fb(), lappend(), lfirst_node, list_make1, LOG, log_parser_stats, new_list(), NIL, nodeToStringWithLocations(), pfree(), QueryRewrite(), ResetUsage(), ShowUsage(), str, and WARNING.
Referenced by fmgr_sql_validator(), inline_sql_function_in_from(), pg_analyze_and_rewrite_fixedparams(), pg_analyze_and_rewrite_varparams(), pg_analyze_and_rewrite_withcb(), prepare_next_query(), and RevalidateCachedQuery().
Definition at line 4364 of file postgres.c.
References AbortCurrentTransaction(), ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, am_walsender, Assert, ConnectionTiming::auth_end, ConnectionTiming::auth_start, BaseInit(), BeginReportingGUCOptions(), buf, CHECK_FOR_INTERRUPTS, ConfigReloadPending, conn_timing, dbname, debug_query_string, DestDebug, DestNone, DestRemote, die, disable_all_timeouts(), disable_timeout(), DISCONNECT_CLIENT_EOF, doing_extended_query_message, DoingCommandRead, drop_unnamed_stmt(), DropPreparedStatement(), EmitErrorReport(), enable_timeout_after(), EndImplicitTransactionBlock(), ereport, errcode(), ERRCODE_PROTOCOL_VIOLATION, errmsg, ERROR, error_context_stack, EventTriggerOnLogin(), exec_bind_message(), exec_describe_portal_message(), exec_describe_statement_message(), exec_execute_message(), exec_parse_message(), exec_replication_command(), exec_simple_query(), FATAL, fb(), finish_xact_command(), FloatExceptionHandler(), FlushErrorState(), forbidden_in_wal_sender(), ConnectionTiming::fork_end, ConnectionTiming::fork_start, get_timeout_active(), GetCurrentTimestamp(), GetPortalByName(), GetProcessingMode, HandleFunctionRequest(), HOLD_INTERRUPTS, i, IDLE_IN_TRANSACTION_SESSION_TIMEOUT, IDLE_SESSION_TIMEOUT, IDLE_STATS_UPDATE_TIMEOUT, IdleInTransactionSessionTimeout, IdleSessionTimeout, ignore_till_sync, INIT_PG_LOAD_SESSION_LIBS, InitializeTimeouts(), InitPostgres(), InitProcessing, initStringInfo(), InitWalSender(), InvalidateCatalogSnapshotConditionally(), InvalidOid, IsAbortedTransactionBlockState(), IsExternalConnectionBackend, IsTransactionOrTransactionBlock(), IsUnderPostmaster, jit_reset_after_error(), len, LOG, LOG_CONNECTION_SETUP_DURATIONS, log_connections, Log_disconnections, log_disconnections(), MAX_CANCEL_KEY_LENGTH, MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), MessageContext, MyBackendType, MyCancelKey, MyCancelKeyLength, MyDatabaseId, MyProcPid, MyProcPort, MyReplicationSlot, NormalProcessing, notifyInterruptPending, NS_PER_US, on_proc_exit(), palloc_array, PG_exception_stack, pg_fallthrough, PG_PROTOCOL, PG_SIG_DFL, PG_SIG_IGN, pg_strong_random(), PGC_SIGHUP, pgstat_report_activity(), pgstat_report_connect(), pgstat_report_stat(), pgStatSessionEndCause, PortalDrop(), PortalErrorCleanup(), PortalIsValid, PostmasterContext, pq_beginmessage(), pq_comm_reset, pq_endmessage(), pq_flush, pq_getmsgbyte(), pq_getmsgend(), pq_getmsgint(), pq_getmsgstring(), pq_is_reading_msg(), pq_putemptymessage(), pq_sendbytes(), pq_sendint32(), PqMsg_BackendKeyData, PqMsg_Bind, PqMsg_Close, PqMsg_CloseComplete, PqMsg_CopyData, PqMsg_CopyDone, PqMsg_CopyFail, PqMsg_Describe, PqMsg_Execute, PqMsg_Flush, PqMsg_FunctionCall, PqMsg_Parse, PqMsg_Query, PqMsg_Sync, PqMsg_Terminate, pqsignal, printf, proc_exit(), ProcessConfigFile(), ProcessNotifyInterrupt(), procsignal_sigusr1_handler(), Port::proto, QueryCancelPending, quickdie(), ReadCommand(), ConnectionTiming::ready_for_use, ReadyForQuery(), ReplicationSlotCleanup(), ReplicationSlotRelease(), ReportChangedGUCOptions(), RESUME_INTERRUPTS, row_description_buf, row_description_context, set_ps_display(), SetCurrentStatementStartTimestamp(), SetProcessingMode, SIGCHLD, SIGHUP, SignalHandlerForConfigReload(), SIGPIPE, SIGQUIT, SIGUSR1, SIGUSR2, ConnectionTiming::socket_create, start_xact_command(), STATE_FASTPATH, STATE_IDLE, STATE_IDLEINTRANSACTION, STATE_IDLEINTRANSACTION_ABORTED, StatementCancelHandler(), TIMESTAMP_MINUS_INFINITY, TimestampDifferenceMicroseconds(), TopMemoryContext, TransactionTimeout, UnBlockSig, username, valgrind_report_error_query, WalSndErrorCleanup(), WalSndSignals(), whereToSendOutput, and xact_started.
Referenced by BackendMain(), and PostgresSingleUserMain().
Definition at line 4221 of file postgres.c.
References Assert, ChangeToDataDir(), checkDataDir(), CreateDataDirLockFile(), CreateSharedMemoryAndSemaphores(), dbname, ereport, errcode(), errmsg, FATAL, fb(), GetCurrentTimestamp(), InitializeFastPathLocks(), InitializeGUCOptions(), InitializeMaxBackends(), InitializeShmemGUCs(), InitializeWalConsistencyChecking(), InitPostmasterChildSlots(), InitProcess(), InitStandaloneProcess(), IsUnderPostmaster, LocalProcessControlFile(), PGC_POSTMASTER, PgStartTime, PostgresMain(), proc_exit(), process_postgres_switches(), process_shared_preload_libraries(), process_shmem_requests(), progname, RegisterBuiltinShmemCallbacks(), SelectConfigFiles(), set_max_safe_fds(), ShmemCallRequestCallbacks(), userDoption, and username.
Referenced by main().
Definition at line 3965 of file postgres.c.
References dbname, DISPATCH_POSTMASTER, EchoQuery, ereport, errcode(), errhint(), errmsg, ERROR, FATAL, fb(), flag(), FrontendProtocol, get_stats_option_name(), IsBinaryUpgrade, IsUnderPostmaster, MAXPGPATH, name, OutputFileName, parse_dispatch_option(), ParseLongOption(), pfree(), pg_fallthrough, pg_getopt_next(), pg_getopt_start(), PGC_POSTMASTER, PGC_S_ARGV, PGC_S_CLIENT, progname, set_debug_options(), set_plan_disabling_options(), SetConfigOption(), strlcpy(), userDoption, UseSemiNewlineNewline, and value.
Referenced by PostgresSingleUserMain(), and process_startup_options().
Definition at line 515 of file postgres.c.
References catchupInterruptPending, CHECK_FOR_INTERRUPTS, DoingCommandRead, fb(), MyLatch, notifyInterruptPending, ProcDiePending, ProcessCatchupInterrupt(), ProcessNotifyInterrupt(), and SetLatch().
Referenced by interactive_getc(), and secure_read().
Definition at line 561 of file postgres.c.
References CHECK_FOR_INTERRUPTS, CritSectionCount, DestNone, DestRemote, fb(), InterruptHoldoffCount, MyLatch, ProcDiePending, SetLatch(), and whereToSendOutput.
Referenced by secure_write().
Definition at line 3452 of file postgres.c.
References AmAutoVacuumWorkerProcess, AmBackgroundWorkerProcess, AmIoWorkerProcess, AmWalReceiverProcess, BackgroundWorker::bgw_type, CheckClientConnectionPending, client_connection_check_interval, CLIENT_CONNECTION_CHECK_TIMEOUT, ClientAuthInProgress, ClientConnectionLost, CritSectionCount, DEBUG1, DestNone, DestRemote, DoingCommandRead, enable_timeout_after(), ereport, errcode(), ERRDETAIL_SIGNAL_SENDER, errmsg, errmsg_internal(), ERROR, FATAL, fb(), get_timeout_finish_time(), get_timeout_indicator(), IdleInTransactionSessionTimeout, IdleInTransactionSessionTimeoutPending, IdleSessionTimeout, IdleSessionTimeoutPending, IdleStatsUpdateTimeoutPending, INJECTION_POINT, InterruptHoldoffCount, InterruptPending, IsLogicalLauncher(), IsLogicalWorker(), IsTransactionOrTransactionBlock(), LOCK_TIMEOUT, LockErrorCleanup(), LogMemoryContextPending, MyBgworkerEntry, MyProc, ParallelApplyMessagePending, ParallelMessagePending, PGPROC::pendingRecoveryConflicts, pg_atomic_read_u32(), pgstat_report_stat(), pq_check_connection(), proc_exit(), ProcDiePending, ProcDieSenderPid, ProcDieSenderUid, ProcessLogMemoryContextInterrupt(), ProcessParallelApplyMessages(), ProcessParallelMessages(), ProcessProcSignalBarrier(), ProcessRecoveryConflictInterrupts(), ProcessRepackMessages(), ProcessSlotSyncMessage(), ProcSignalBarrierPending, QueryCancelHoldoffCount, QueryCancelPending, RepackMessagePending, SlotSyncShutdownPending, STATEMENT_TIMEOUT, TransactionTimeout, TransactionTimeoutPending, and whereToSendOutput.
Referenced by die().
|
static |
Definition at line 3199 of file postgres.c.
References CheckDeadLockAlert(), elog, FATAL, fb(), GetAwaitedLock(), HoldingBufferPinThatDelaysRecovery(), IsTransactionOrTransactionBlock(), RECOVERY_CONFLICT_BUFFERPIN, RECOVERY_CONFLICT_BUFFERPIN_DEADLOCK, RECOVERY_CONFLICT_DATABASE, RECOVERY_CONFLICT_LOCK, RECOVERY_CONFLICT_LOGICALSLOT, RECOVERY_CONFLICT_SNAPSHOT, RECOVERY_CONFLICT_STARTUP_DEADLOCK, RECOVERY_CONFLICT_TABLESPACE, and report_recovery_conflict().
Referenced by ProcessRecoveryConflictInterrupts().
Definition at line 3401 of file postgres.c.
References Assert, fb(), InterruptHoldoffCount, MyProc, NUM_RECOVERY_CONFLICT_REASONS, PGPROC::pendingRecoveryConflicts, pg_atomic_fetch_and_u32(), pg_atomic_read_membarrier_u32(), proc_exit_inprogress, and ProcessRecoveryConflictInterrupt().
Referenced by ProcessInterrupts().
| void quickdie | ( | SIGNAL_ARGS | ) |
Definition at line 3017 of file postgres.c.
References BlockSig, ClientAuthInProgress, DestNone, DestRemote, ereport, errcode(), errdetail(), errhint(), errmsg, error_context_stack, fb(), GetQuitSignalReason(), HOLD_INTERRUPTS, PMQUIT_FOR_CRASH, PMQUIT_FOR_STOP, PMQUIT_NOT_SENT, SIGQUIT, WARNING, WARNING_CLIENT_ONLY, and whereToSendOutput.
Referenced by PostgresMain().
|
static |
Definition at line 494 of file postgres.c.
References DestRemote, fb(), InteractiveBackend(), result, SocketBackend(), and whereToSendOutput.
Referenced by PostgresMain().
|
static |
Definition at line 3295 of file postgres.c.
References DoingCommandRead, ereport, errcode(), ERRCODE_T_R_SERIALIZATION_FAILURE, errdetail_recovery_conflict(), errhint(), errmsg, ERROR, FATAL, fb(), InterruptPending, IsAbortedTransactionBlockState(), IsSubTransaction(), LockErrorCleanup(), MyProc, PGPROC::pendingRecoveryConflicts, pg_atomic_fetch_or_u32(), pgstat_report_recovery_conflict(), QueryCancelHoldoffCount, RECOVERY_CONFLICT_DATABASE, and RECOVERY_CONFLICT_LOGICALSLOT.
Referenced by ProcessRecoveryConflictInterrupt().
Definition at line 5232 of file postgres.c.
References fb(), getrusage(), gettimeofday(), RUSAGE_SELF, Save_r, and Save_t.
Referenced by _bt_leader_participate_as_worker(), _bt_leafbuild(), _bt_parallel_build_main(), _SPI_pquery(), btbuild(), exec_bind_message(), exec_execute_message(), exec_parse_message(), exec_simple_query(), pg_analyze_and_rewrite_fixedparams(), pg_analyze_and_rewrite_varparams(), pg_analyze_and_rewrite_withcb(), pg_parse_query(), pg_plan_query(), pg_rewrite_query(), PortalRun(), and PortalRunMulti().
| void set_debug_options | ( | int | debug_flag, |
| GucContext | context, | ||
| GucSource | source | ||
| ) |
Definition at line 3851 of file postgres.c.
References fb(), PGC_POSTMASTER, SetConfigOption(), source, and sprintf.
Referenced by PostmasterMain(), and process_postgres_switches().
| bool set_plan_disabling_options | ( | const char * | arg, |
| GucContext | context, | ||
| GucSource | source | ||
| ) |
Definition at line 3883 of file postgres.c.
References arg, fb(), SetConfigOption(), and source.
Referenced by PostmasterMain(), and process_postgres_switches().
Definition at line 5239 of file postgres.c.
References __darwin__, appendStringInfo(), appendStringInfoString(), ereport, errdetail_internal(), errmsg_internal(), fb(), getrusage(), gettimeofday(), initStringInfo(), LOG, memcpy(), pfree(), rusage::ru_stime, rusage::ru_utime, RUSAGE_SELF, Save_r, Save_t, str, and user.
Referenced by _bt_leader_participate_as_worker(), _bt_leafbuild(), _bt_parallel_build_main(), _SPI_pquery(), btbuild(), exec_bind_message(), exec_execute_message(), exec_parse_message(), exec_simple_query(), pg_analyze_and_rewrite_fixedparams(), pg_analyze_and_rewrite_varparams(), pg_analyze_and_rewrite_withcb(), pg_parse_query(), pg_plan_query(), pg_rewrite_query(), PortalRun(), and PortalRunMulti().
|
static |
Definition at line 366 of file postgres.c.
References COMMERROR, DEBUG1, DestNone, doing_extended_query_message, ereport, errcode(), ERRCODE_PROTOCOL_VIOLATION, errmsg, errmsg_internal(), FATAL, fb(), HOLD_CANCEL_INTERRUPTS, ignore_till_sync, IsTransactionState(), pq_getbyte(), pq_getmessage(), PQ_LARGE_MESSAGE_LIMIT, PQ_SMALL_MESSAGE_LIMIT, pq_startmsgread(), PqMsg_Bind, PqMsg_Close, PqMsg_CopyData, PqMsg_CopyDone, PqMsg_CopyFail, PqMsg_Describe, PqMsg_Execute, PqMsg_Flush, PqMsg_FunctionCall, PqMsg_Parse, PqMsg_Query, PqMsg_Sync, PqMsg_Terminate, RESUME_CANCEL_INTERRUPTS, and whereToSendOutput.
Referenced by ReadCommand().
Definition at line 2874 of file postgres.c.
References BeginImplicitTransactionBlock(), client_connection_check_interval, CLIENT_CONNECTION_CHECK_TIMEOUT, enable_statement_timeout(), enable_timeout_after(), get_timeout_active(), IsUnderPostmaster, MyProcPort, MyXactFlags, StartTransactionCommand(), XACT_FLAGS_PIPELINING, and xact_started.
Referenced by exec_bind_message(), exec_describe_portal_message(), exec_describe_statement_message(), exec_execute_message(), exec_parse_message(), exec_simple_query(), and PostgresMain().
| void StatementCancelHandler | ( | SIGNAL_ARGS | ) |
Definition at line 3155 of file postgres.c.
References InterruptPending, MyLatch, proc_exit_inprogress, QueryCancelPending, and SetLatch().
Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), BackgroundWorkerMain(), PostgresMain(), ReplSlotSyncWorkerMain(), and WalSndSignals().
Definition at line 2543 of file postgres.c.
References fb(), log_statement_max_length, MAX_MULTIBYTE_CHAR_LEN, memcpy(), palloc(), and pg_mbcliplen().
Referenced by errdetail_execute(), exec_bind_message(), exec_execute_message(), exec_parse_message(), and exec_simple_query().
| int client_connection_check_interval = 0 |
Definition at line 108 of file postgres.c.
Referenced by ProcessInterrupts(), and start_xact_command().
Definition at line 94 of file postgres.c.
Referenced by _brin_begin_parallel(), _brin_parallel_build_main(), _bt_begin_parallel(), _bt_parallel_build_main(), _gin_begin_parallel(), _gin_parallel_build_main(), check_log_of_query(), current_query(), errstart(), exec_bind_message(), exec_execute_message(), exec_parse_message(), exec_replication_command(), exec_simple_query(), initialize_worker_spi(), parallel_vacuum_init(), parallel_vacuum_main(), ParallelQueryMain(), PostgresMain(), proc_exit_prepare(), send_message_to_server_log(), worker_spi_main(), write_csvlog(), and write_jsonlog().
Definition at line 157 of file postgres.c.
Referenced by PostgresMain(), and SocketBackend().
Definition at line 151 of file postgres.c.
Referenced by die(), PostgresMain(), ProcessClientReadInterrupt(), ProcessInterrupts(), and report_recovery_conflict().
Definition at line 169 of file postgres.c.
Referenced by InteractiveBackend(), and process_postgres_switches().
Definition at line 158 of file postgres.c.
Referenced by PostgresMain(), and SocketBackend().
Definition at line 100 of file postgres.c.
Referenced by PostgresMain().
| int log_statement = LOGSTMT_NONE |
Definition at line 102 of file postgres.c.
Referenced by check_log_statement(), and HandleFunctionRequest().
| int PostAuthDelay = 0 |
Definition at line 105 of file postgres.c.
Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), BackgroundWorkerMain(), and InitPostgres().
| int restrict_nonsystem_relation_kind |
Definition at line 111 of file postgres.c.
Referenced by ApplyRetrieveRule(), assign_restrict_nonsystem_relation_kind(), get_relation_info(), GetFdwRoutine(), make_modifytable(), and rewriteTargetView().
|
static |
Definition at line 174 of file postgres.c.
Referenced by exec_describe_portal_message(), exec_describe_statement_message(), and PostgresMain().
|
static |
Definition at line 173 of file postgres.c.
Referenced by PostgresMain().
|
static |
Definition at line 5228 of file postgres.c.
Referenced by ResetUsage(), and ShowUsage().
|
static |
Definition at line 5229 of file postgres.c.
Referenced by ResetUsage(), and ShowUsage().
|
static |
Definition at line 165 of file postgres.c.
Referenced by drop_unnamed_stmt(), exec_bind_message(), exec_describe_statement_message(), and exec_parse_message().
Definition at line 168 of file postgres.c.
Referenced by BootstrapModeMain(), PostgresSingleUserMain(), PostmasterMain(), process_postgres_switches(), and SelectConfigFiles().
Definition at line 170 of file postgres.c.
Referenced by InteractiveBackend(), and process_postgres_switches().
| CommandDest whereToSendOutput = DestDebug |
Definition at line 97 of file postgres.c.
Referenced by BackendInitialize(), BeginCopyFrom(), BeginCopyTo(), BeginReportingGUCOptions(), die(), DoCopyTo(), errfinish(), exec_bind_message(), exec_describe_portal_message(), exec_describe_statement_message(), exec_execute_message(), exec_parse_message(), exec_simple_query(), NotifyMyFrontEnd(), PostgresMain(), PostmasterMain(), pq_cleanup_redirect_to_shm_mq(), pq_redirect_to_shm_mq(), ProcessClientWriteInterrupt(), ProcessInterrupts(), quickdie(), ReadCommand(), send_message_to_server_log(), should_output_to_client(), SocketBackend(), SyncRepWaitForLSN(), SysLoggerMain(), WalSndDoneImmediate(), and WalSndShutdown().
Definition at line 144 of file postgres.c.
Referenced by enable_statement_timeout(), finish_xact_command(), PostgresMain(), and start_xact_command().