|
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 "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_getopt.h"#include "pg_trace.h"#include "pgstat.h"#include "postmaster/interrupt.h"#include "postmaster/postmaster.h"#include "replication/logicallauncher.h"#include "replication/logicalworker.h"#include "replication/slot.h"#include "replication/walsender.h"#include "rewrite/rewriteHandler.h"#include "storage/bufmgr.h"#include "storage/ipc.h"#include "storage/pmsignal.h"#include "storage/proc.h"#include "storage/procsignal.h"#include "storage/sinval.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 | valgrind_report_error_query(query) ((void) 0) |
Typedefs | |
| typedef struct BindParamCbData | BindParamCbData |
Definition at line 217 of file postgres.c.
Definition at line 3671 of file postgres.c.
References restrict_nonsystem_relation_kind.
Definition at line 3600 of file postgres.c.
References disable_timeout(), enable_timeout_after(), get_timeout_active(), IsTransactionState(), newval, and TRANSACTION_TIMEOUT.
Definition at line 2598 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 3550 of file postgres.c.
References GUC_check_errdetail, newval, and WaitEventSetCanReportClosed().
Definition at line 2429 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 2390 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 3585 of file postgres.c.
References GUC_check_errdetail, log_executor_stats, log_parser_stats, log_planner_stats, and newval.
Definition at line 3619 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 3571 of file postgres.c.
References GUC_check_errdetail, log_statement_stats, and newval.
| void die | ( | SIGNAL_ARGS | ) |
Definition at line 3032 of file postgres.c.
References DestRemote, DISCONNECT_KILLED, DoingCommandRead, InterruptPending, MyLatch, pgStatSessionEndCause, proc_exit_inprogress, ProcDiePending, ProcessInterrupts(), SetLatch(), and whereToSendOutput.
Definition at line 5235 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 2910 of file postgres.c.
References DropCachedPlan(), fb(), and unnamed_stmt_psrc.
Referenced by exec_parse_message(), exec_simple_query(), and PostgresMain().
Definition at line 5213 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 2545 of file postgres.c.
References errdetail(), MyProc, and PGPROC::recoveryConflictPending.
Referenced by exec_bind_message(), exec_describe_portal_message(), exec_describe_statement_message(), exec_execute_message(), exec_parse_message(), and exec_simple_query().
Definition at line 2492 of file postgres.c.
References errdetail(), fb(), FetchPreparedStatement(), IsA, lfirst_node, PreparedStatement::plansource, CachedPlanSource::query_string, RawStmt::stmt, and stmt.
Referenced by exec_simple_query().
|
static |
Definition at line 2525 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 2559 of file postgres.c.
References errdetail(), PROCSIG_RECOVERY_CONFLICT_BUFFERPIN, PROCSIG_RECOVERY_CONFLICT_DATABASE, PROCSIG_RECOVERY_CONFLICT_LOCK, PROCSIG_RECOVERY_CONFLICT_LOGICALSLOT, PROCSIG_RECOVERY_CONFLICT_SNAPSHOT, PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK, and PROCSIG_RECOVERY_CONFLICT_TABLESPACE.
Referenced by ProcessRecoveryConflictInterrupt().
|
static |
Definition at line 1630 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(), errdetail_abort(), 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, unconstify, unnamed_stmt_psrc, valgrind_report_error_query, ParamExternData::value, and whereToSendOutput.
Referenced by PostgresMain().
Definition at line 2740 of file postgres.c.
References DestRemote, ereport, errcode(), errdetail_abort(), 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 2647 of file postgres.c.
References Assert, CachedPlanGetTargetList(), DestRemote, ereport, errcode(), errdetail_abort(), 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 2113 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_abort(), 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(), 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, valgrind_report_error_query, whereToSendOutput, XACT_FLAGS_NEEDIMMEDIATECOMMIT, and XACT_FLAGS_PIPELINING.
Referenced by PostgresMain().
|
static |
Definition at line 1395 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(), errdetail_abort(), errhidestmt(), errmsg(), errmsg_internal(), ERROR, fb(), GetTransactionSnapshot(), IsAbortedTransactionBlockState(), IsTransactionExitStmt(), linitial_node, list_length(), LOG, log_statement_stats, MemoryContextSetParent(), MemoryContextSwitchTo(), MessageContext, NIL, 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(), unnamed_stmt_psrc, and whereToSendOutput.
Referenced by PostgresMain().
Definition at line 1017 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_abort(), 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(), 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, PortalData::visible, whereToSendOutput, and XACT_FLAGS_NEEDIMMEDIATECOMMIT.
Referenced by PostgresMain().
Definition at line 2831 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 3079 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 5041 of file postgres.c.
References am_walsender, ereport, errcode(), errmsg(), ERROR, fb(), and PqMsg_FunctionCall.
Referenced by PostgresMain().
Definition at line 3759 of file postgres.c.
References arg, fb(), and optarg.
Referenced by PostmasterMain(), and process_postgres_switches().
| void HandleRecoveryConflictInterrupt | ( | ProcSignalReason | reason | ) |
Definition at line 3095 of file postgres.c.
References InterruptPending, RecoveryConflictPending, and RecoveryConflictPendingReasons.
Referenced by procsignal_sigusr1_handler().
Definition at line 325 of file postgres.c.
References CHECK_FOR_INTERRUPTS, fb(), and ProcessClientReadInterrupt().
Referenced by InteractiveBackend().
|
static |
Definition at line 237 of file postgres.c.
References appendStringInfoChar(), EchoQuery, fb(), interactive_getc(), PqMsg_Query, printf, resetStringInfo(), and UseSemiNewlineNewline.
Referenced by ReadCommand().
Definition at line 2863 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 2880 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 2895 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 5177 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 670 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 709 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 763 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 604 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 975 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 887 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 803 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 4193 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(), 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_PROTOCOL, 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 4064 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, SelectConfigFiles(), set_max_safe_fds(), userDoption, and username.
Referenced by main().
Definition at line 3799 of file postgres.c.
References dbname, DISPATCH_POSTMASTER, EchoQuery, ereport, errcode(), errhint(), errmsg(), ERROR, FATAL, fb(), flag(), FrontendProtocol, get_stats_option_name(), getopt(), IsBinaryUpgrade, IsUnderPostmaster, MAXPGPATH, name, optarg, opterr, optind, OutputFileName, parse_dispatch_option(), ParseLongOption(), pfree(), 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 502 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 548 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 3304 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(), 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, ParallelApplyMessagePending, ParallelMessagePending, pgstat_report_stat(), pq_check_connection(), proc_exit(), ProcDiePending, ProcessLogMemoryContextInterrupt(), ProcessParallelApplyMessages(), ProcessParallelMessages(), ProcessProcSignalBarrier(), ProcessRecoveryConflictInterrupts(), ProcSignalBarrierPending, QueryCancelHoldoffCount, QueryCancelPending, RecoveryConflictPending, STATEMENT_TIMEOUT, TransactionTimeout, TransactionTimeoutPending, and whereToSendOutput.
Referenced by die().
|
static |
Definition at line 3107 of file postgres.c.
References CheckDeadLockAlert(), DoingCommandRead, elog, ereport, errcode(), ERRCODE_T_R_SERIALIZATION_FAILURE, errdetail_recovery_conflict(), errhint(), errmsg(), ERROR, FATAL, fb(), GetAwaitedLock(), GetStartupBufferPinWaitBufId(), HoldingBufferPinThatDelaysRecovery(), InterruptPending, IsAbortedTransactionBlockState(), IsSubTransaction(), IsTransactionOrTransactionBlock(), LockErrorCleanup(), MyProc, pgstat_report_recovery_conflict(), PROCSIG_RECOVERY_CONFLICT_BUFFERPIN, PROCSIG_RECOVERY_CONFLICT_DATABASE, PROCSIG_RECOVERY_CONFLICT_LOCK, PROCSIG_RECOVERY_CONFLICT_LOGICALSLOT, PROCSIG_RECOVERY_CONFLICT_SNAPSHOT, PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK, PROCSIG_RECOVERY_CONFLICT_TABLESPACE, QueryCancelHoldoffCount, RecoveryConflictPending, PGPROC::recoveryConflictPending, and RecoveryConflictPendingReasons.
Referenced by ProcessRecoveryConflictInterrupts().
Definition at line 3265 of file postgres.c.
References Assert, InterruptHoldoffCount, proc_exit_inprogress, ProcessRecoveryConflictInterrupt(), PROCSIG_RECOVERY_CONFLICT_FIRST, PROCSIG_RECOVERY_CONFLICT_LAST, RecoveryConflictPending, and RecoveryConflictPendingReasons.
Referenced by ProcessInterrupts().
| void quickdie | ( | SIGNAL_ARGS | ) |
Definition at line 2935 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 481 of file postgres.c.
References DestRemote, fb(), InteractiveBackend(), SocketBackend(), and whereToSendOutput.
Referenced by PostgresMain().
Definition at line 5061 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 3685 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 3717 of file postgres.c.
References arg, fb(), SetConfigOption(), and source.
Referenced by PostmasterMain(), and process_postgres_switches().
Definition at line 5068 of file postgres.c.
References __darwin__, appendStringInfo(), appendStringInfoString(), ereport, errdetail_internal(), errmsg_internal(), fb(), getrusage(), gettimeofday(), initStringInfo(), LOG, 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 353 of file postgres.c.
References COMMERROR, DEBUG1, DestNone, doing_extended_query_message, ereport, errcode(), 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 2792 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 3062 of file postgres.c.
References InterruptPending, MyLatch, proc_exit_inprogress, QueryCancelPending, and SetLatch().
Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), BackgroundWorkerMain(), PostgresMain(), ReplSlotSyncWorkerMain(), and WalSndSignals().
| int client_connection_check_interval = 0 |
Definition at line 103 of file postgres.c.
Referenced by ProcessInterrupts(), and start_xact_command().
Definition at line 89 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 143 of file postgres.c.
Referenced by PostgresMain(), and SocketBackend().
Definition at line 137 of file postgres.c.
Referenced by die(), PostgresMain(), ProcessClientReadInterrupt(), ProcessInterrupts(), and ProcessRecoveryConflictInterrupt().
Definition at line 155 of file postgres.c.
Referenced by InteractiveBackend(), and process_postgres_switches().
Definition at line 144 of file postgres.c.
Referenced by PostgresMain(), and SocketBackend().
Definition at line 95 of file postgres.c.
Referenced by PostgresMain().
| int log_statement = LOGSTMT_NONE |
Definition at line 97 of file postgres.c.
Referenced by check_log_statement(), and HandleFunctionRequest().
| int PostAuthDelay = 0 |
Definition at line 100 of file postgres.c.
Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), BackgroundWorkerMain(), and InitPostgres().
|
static |
Definition at line 159 of file postgres.c.
Referenced by HandleRecoveryConflictInterrupt(), ProcessInterrupts(), ProcessRecoveryConflictInterrupt(), and ProcessRecoveryConflictInterrupts().
|
static |
Definition at line 160 of file postgres.c.
Referenced by HandleRecoveryConflictInterrupt(), ProcessRecoveryConflictInterrupt(), and ProcessRecoveryConflictInterrupts().
| int restrict_nonsystem_relation_kind |
Definition at line 106 of file postgres.c.
Referenced by ApplyRetrieveRule(), assign_restrict_nonsystem_relation_kind(), get_relation_info(), GetFdwRoutine(), make_modifytable(), and rewriteTargetView().
|
static |
Definition at line 164 of file postgres.c.
Referenced by exec_describe_portal_message(), exec_describe_statement_message(), and PostgresMain().
|
static |
Definition at line 163 of file postgres.c.
Referenced by PostgresMain().
Definition at line 5057 of file postgres.c.
Referenced by ResetUsage(), and ShowUsage().
Definition at line 5058 of file postgres.c.
Referenced by ResetUsage(), and ShowUsage().
|
static |
Definition at line 151 of file postgres.c.
Referenced by drop_unnamed_stmt(), exec_bind_message(), exec_describe_statement_message(), and exec_parse_message().
Definition at line 154 of file postgres.c.
Referenced by BootstrapModeMain(), PostgresSingleUserMain(), PostmasterMain(), process_postgres_switches(), and SelectConfigFiles().
Definition at line 156 of file postgres.c.
Referenced by InteractiveBackend(), and process_postgres_switches().
| CommandDest whereToSendOutput = DestDebug |
Definition at line 92 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(), and WalSndShutdown().
Definition at line 130 of file postgres.c.
Referenced by enable_statement_timeout(), finish_xact_command(), PostgresMain(), and start_xact_command().