PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <sys/param.h>
#include <signal.h>
#include <time.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <grp.h>
#include <pwd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <utime.h>
#include "access/htup_details.h"
#include "catalog/pg_authid.h"
#include "common/file_perm.h"
#include "libpq/libpq.h"
#include "libpq/pqsignal.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "postmaster/autovacuum.h"
#include "postmaster/interrupt.h"
#include "postmaster/postmaster.h"
#include "storage/fd.h"
#include "storage/ipc.h"
#include "storage/latch.h"
#include "storage/pg_shmem.h"
#include "storage/pmsignal.h"
#include "storage/proc.h"
#include "storage/procarray.h"
#include "utils/builtins.h"
#include "utils/guc.h"
#include "utils/inval.h"
#include "utils/memutils.h"
#include "utils/pidfile.h"
#include "utils/syscache.h"
#include "utils/varlena.h"
Go to the source code of this file.
Macros | |
#define | DIRECTORY_LOCK_FILE "postmaster.pid" |
Functions | |
void | InitPostmasterChild (void) |
void | InitStandaloneProcess (const char *argv0) |
void | SwitchToSharedLatch (void) |
void | SwitchBackToLocalLatch (void) |
const char * | GetBackendTypeDesc (BackendType backendType) |
void | SetDatabasePath (const char *path) |
void | checkDataDir (void) |
void | SetDataDir (const char *dir) |
void | ChangeToDataDir (void) |
Oid | GetUserId (void) |
Oid | GetOuterUserId (void) |
static void | SetOuterUserId (Oid userid) |
Oid | GetSessionUserId (void) |
static void | SetSessionUserId (Oid userid, bool is_superuser) |
Oid | GetAuthenticatedUserId (void) |
void | GetUserIdAndSecContext (Oid *userid, int *sec_context) |
void | SetUserIdAndSecContext (Oid userid, int sec_context) |
bool | InLocalUserIdChange (void) |
bool | InSecurityRestrictedOperation (void) |
bool | InNoForceRLSOperation (void) |
void | GetUserIdAndContext (Oid *userid, bool *sec_def_context) |
void | SetUserIdAndContext (Oid userid, bool sec_def_context) |
bool | has_rolreplication (Oid roleid) |
void | InitializeSessionUserId (const char *rolename, Oid roleid) |
void | InitializeSessionUserIdStandalone (void) |
void | SetSessionAuthorization (Oid userid, bool is_superuser) |
Oid | GetCurrentRoleId (void) |
void | SetCurrentRoleId (Oid roleid, bool is_superuser) |
char * | GetUserNameFromId (Oid roleid, bool noerr) |
static void | UnlinkLockFiles (int status, Datum arg) |
static void | CreateLockFile (const char *filename, bool amPostmaster, const char *socketDir, bool isDDLock, const char *refName) |
void | CreateDataDirLockFile (bool amPostmaster) |
void | CreateSocketLockFile (const char *socketfile, bool amPostmaster, const char *socketDir) |
void | TouchSocketLockFiles (void) |
void | AddToDataDirLockFile (int target_line, const char *str) |
bool | RecheckDataDirLockFile (void) |
void | ValidatePgVersion (const char *path) |
static void | load_libraries (const char *libraries, const char *gucname, bool restricted) |
void | process_shared_preload_libraries (void) |
void | process_session_preload_libraries (void) |
void | pg_bindtextdomain (const char *domain) |
Variables | |
ProcessingMode | Mode = InitProcessing |
BackendType | MyBackendType |
static List * | lock_files = NIL |
static Latch | LocalLatchData |
bool | IgnoreSystemIndexes = false |
static Oid | AuthenticatedUserId = InvalidOid |
static Oid | SessionUserId = InvalidOid |
static Oid | OuterUserId = InvalidOid |
static Oid | CurrentUserId = InvalidOid |
static bool | AuthenticatedUserIsSuperuser = false |
static bool | SessionUserIsSuperuser = false |
static int | SecurityRestrictionContext = 0 |
static bool | SetRoleIsActive = false |
char * | session_preload_libraries_string = NULL |
char * | shared_preload_libraries_string = NULL |
char * | local_preload_libraries_string = NULL |
bool | process_shared_preload_libraries_in_progress = false |
#define DIRECTORY_LOCK_FILE "postmaster.pid" |
Definition at line 58 of file miscinit.c.
Referenced by AddToDataDirLockFile(), CreateDataDirLockFile(), RecheckDataDirLockFile(), and TouchSocketLockFiles().
void AddToDataDirLockFile | ( | int | target_line, |
const char * | str | ||
) |
Definition at line 1329 of file miscinit.c.
References close, DIRECTORY_LOCK_FILE, ereport, errcode_for_file_access(), errmsg(), fd(), LOG, PG_BINARY, pg_fsync(), pg_pwrite(), pgstat_report_wait_end(), pgstat_report_wait_start(), read, snprintf, WAIT_EVENT_LOCK_FILE_ADDTODATADIR_READ, WAIT_EVENT_LOCK_FILE_ADDTODATADIR_SYNC, and WAIT_EVENT_LOCK_FILE_ADDTODATADIR_WRITE.
Referenced by InternalIpcMemoryCreate(), pmdie(), PostmasterMain(), reaper(), and sigusr1_handler().
void ChangeToDataDir | ( | void | ) |
Definition at line 416 of file miscinit.c.
References AssertState, DataDir, ereport, errcode_for_file_access(), errmsg(), and FATAL.
Referenced by AuxiliaryProcessMain(), PostgresMain(), and PostmasterMain().
void checkDataDir | ( | void | ) |
Definition at line 302 of file miscinit.c.
References Assert, data_directory_mode, DataDir, ereport, errcode(), errcode_for_file_access(), errdetail(), errhint(), errmsg(), FATAL, pg_dir_create_mode, pg_mode_mask, PG_MODE_MASK_GROUP, S_ISDIR, SetDataDirectoryCreatePerm(), stat::st_mode, stat::st_uid, stat, and ValidatePgVersion().
Referenced by AuxiliaryProcessMain(), BackendRun(), PostgresMain(), and PostmasterMain().
void CreateDataDirLockFile | ( | bool | amPostmaster | ) |
Definition at line 1273 of file miscinit.c.
References CreateLockFile(), DataDir, and DIRECTORY_LOCK_FILE.
Referenced by AuxiliaryProcessMain(), PostgresMain(), and PostmasterMain().
|
static |
Definition at line 968 of file miscinit.c.
References close, DataDir, elog, ereport, errcode(), errcode_for_file_access(), errhint(), errmsg(), FATAL, fd(), kill, lcons(), LOCK_FILE_LINE_SHMEM_KEY, MAXPGPATH, MyStartTime, NIL, on_proc_exit(), pg_file_create_mode, pg_fsync(), PGSharedMemoryIsInUse(), pgstat_report_wait_end(), pgstat_report_wait_start(), PostPortNumber, pstrdup(), read, snprintf, strlcat(), UnlinkLockFiles(), WAIT_EVENT_LOCK_FILE_CREATE_READ, WAIT_EVENT_LOCK_FILE_CREATE_SYNC, WAIT_EVENT_LOCK_FILE_CREATE_WRITE, and write.
Referenced by CreateDataDirLockFile(), and CreateSocketLockFile().
void CreateSocketLockFile | ( | const char * | socketfile, |
bool | amPostmaster, | ||
const char * | socketDir | ||
) |
Definition at line 1282 of file miscinit.c.
References CreateLockFile(), MAXPGPATH, and snprintf.
Referenced by StreamServerPort().
Oid GetAuthenticatedUserId | ( | void | ) |
Definition at line 535 of file miscinit.c.
References AssertState, AuthenticatedUserId, and OidIsValid.
Referenced by InitializeParallelDSM().
const char* GetBackendTypeDesc | ( | BackendType | backendType | ) |
Definition at line 230 of file miscinit.c.
References B_ARCHIVER, B_AUTOVAC_LAUNCHER, B_AUTOVAC_WORKER, B_BACKEND, B_BG_WORKER, B_BG_WRITER, B_CHECKPOINTER, B_INVALID, B_LOGGER, B_STARTUP, B_STATS_COLLECTOR, B_WAL_RECEIVER, B_WAL_SENDER, and B_WAL_WRITER.
Referenced by BackendInitialize(), init_ps_display(), log_line_prefix(), pg_stat_get_activity(), and write_csvlog().
Oid GetCurrentRoleId | ( | void | ) |
Definition at line 835 of file miscinit.c.
References InvalidOid, OuterUserId, and SetRoleIsActive.
Referenced by InitializeParallelDSM(), and show_role().
Oid GetOuterUserId | ( | void | ) |
Definition at line 487 of file miscinit.c.
References AssertState, OidIsValid, and OuterUserId.
Referenced by DropRole(), and RenameRole().
Oid GetSessionUserId | ( | void | ) |
Definition at line 510 of file miscinit.c.
References AssertState, OidIsValid, and SessionUserId.
Referenced by check_role(), DropRole(), get_rolespec_oid(), get_rolespec_tuple(), InitPostgres(), is_admin_of_role(), pgstat_bestart(), RenameRole(), and session_user().
Oid GetUserId | ( | void | ) |
Definition at line 476 of file miscinit.c.
References AssertState, CurrentUserId, and OidIsValid.
Referenced by AddRoleMems(), AggregateCreate(), AlterDatabase(), AlterDatabaseOwner(), AlterDatabaseSet(), AlterEventTrigger(), AlterEventTriggerOwner_internal(), AlterExtensionNamespace(), AlterForeignServer(), AlterForeignServerOwner_internal(), AlterFunction(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), AlterOperator(), AlterOpFamilyAdd(), AlterPublication(), AlterPublicationOwner_internal(), AlterRole(), AlterRoleSet(), AlterSchemaOwner_internal(), AlterStatistics(), AlterSubscription(), AlterSubscriptionOwner_internal(), AlterTableMoveAll(), AlterTableSpaceOptions(), AlterTSConfiguration(), AlterTSDictionary(), AlterType(), AlterTypeNamespace_oid(), AlterTypeOwner(), ATExecAddColumn(), ATExecChangeOwner(), ATPrepAlterColumnType(), ATPrepSetTableSpace(), ATSimplePermissions(), be_lo_put(), be_lo_unlink(), binary_upgrade_create_empty_extension(), brin_desummarize_range(), brin_summarize_range(), BuildCachedPlan(), BuildDescForRelation(), BuildIndexValueDescription(), calculate_database_size(), calculate_tablespace_size(), call_pltcl_start_proc(), check_enable_rls(), check_permissions(), check_temp_tablespaces(), CheckCachedPlan(), checkDomainOwner(), checkEnumOwner(), checkFkeyPermissions(), CheckFunctionValidatorAccess(), CheckMyDatabase(), cluster_rel(), CommentObject(), compile_plperl_function(), compile_pltcl_function(), CompleteCachedPlan(), compute_return_type(), convert_and_check_filename(), create_foreign_modify(), CreateCast(), CreateConversionCommand(), createdb(), CreateEventTrigger(), CreateExtensionInternal(), CreateForeignDataWrapper(), CreateForeignServer(), CreateForeignTable(), CreateFunction(), CreateOpFamily(), CreateProceduralLanguage(), CreatePublication(), CreateRole(), CreateStatistics(), CreateSubscription(), CreateTableSpace(), CreateTransform(), CreateTrigger(), current_user(), currtid_internal(), currval_oid(), DefineAggregate(), DefineCollation(), DefineDomain(), DefineEnum(), DefineIndex(), DefineOpClass(), DefineOperator(), DefineOpFamily(), DefineQueryRewrite(), DefineRange(), DefineRelation(), DefineTSConfiguration(), DefineTSDictionary(), DefineType(), DelRoleMems(), do_setval(), DoCopy(), dropdb(), DropOwnedObjects(), DropRole(), DropSubscription(), DropTableSpace(), EnableDisableRule(), examine_simple_variable(), examine_variable(), ExecAlterDefaultPrivilegesStmt(), ExecAlterExtensionContentsStmt(), ExecAlterExtensionStmt(), ExecAlterObjectDependsStmt(), ExecBuildGroupingEqual(), ExecBuildSlotPartitionKeyDescription(), ExecBuildSlotValueDescription(), ExecCheckRTEPerms(), ExecGrant_Attribute(), ExecGrant_Database(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Largeobject(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecGrant_Tablespace(), ExecGrant_Type(), ExecInitAgg(), ExecInitExprRec(), ExecInitFunc(), ExecInitWindowAgg(), ExecSecLabelStmt(), execute_extension_script(), ExecuteCallStmt(), ExecuteDoStmt(), ExecuteTruncateGuts(), extension_is_trusted(), file_fdw_validator(), findRangeCanonicalFunction(), findRangeSubtypeDiffFunction(), FinishPreparedTransaction(), get_connect_string(), get_explain_guc_options(), get_other_operator(), get_rel_from_relname(), get_rolespec_oid(), get_rolespec_tuple(), get_row_security_policies(), get_tables_to_cluster(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionByNum(), GetConfigOptionResetString(), gin_clean_pending_list(), GrantRole(), HandleFunctionRequest(), has_any_column_privilege_id(), has_any_column_privilege_name(), has_column_privilege_id_attnum(), has_column_privilege_id_name(), has_column_privilege_name_attnum(), has_column_privilege_name_name(), has_database_privilege_id(), has_database_privilege_name(), has_foreign_data_wrapper_privilege_id(), has_foreign_data_wrapper_privilege_name(), has_function_privilege_id(), has_function_privilege_name(), has_language_privilege_id(), has_language_privilege_name(), has_schema_privilege_id(), has_schema_privilege_name(), has_sequence_privilege_id(), has_sequence_privilege_name(), has_server_privilege_id(), has_server_privilege_name(), has_table_privilege_id(), has_table_privilege_name(), has_tablespace_privilege_id(), has_tablespace_privilege_name(), has_type_privilege_id(), has_type_privilege_name(), have_createdb_privilege(), have_createrole_privilege(), ImportForeignSchema(), init_sexpr(), InitializeSearchPath(), InitPostgres(), InitTempTableNamespace(), inline_function(), inline_set_returning_function(), insert_username(), interpret_function_parameter_list(), inv_create(), inv_open(), LargeObjectCreate(), lastval(), lookup_agg_function(), LookupCreationNamespace(), LookupExplicitNamespace(), MergeAttributes(), movedb(), nextval_internal(), OperatorCreate(), OperatorShellMake(), pg_has_role_id(), pg_has_role_name(), pg_import_system_collations(), pg_prewarm(), pg_sequence_last_value(), pg_sequence_parameters(), pg_signal_backend(), pg_stat_get_wal_receiver(), pg_stat_get_wal_senders(), pg_stat_statements_internal(), pgrowlocks(), pgss_store(), pgstat_get_backend_current_activity(), pltcl_fetch_interp(), postgresBeginDirectModify(), postgresBeginForeignScan(), postgresGetForeignRelSize(), postgresImportForeignSchema(), PrepareTempTablespaces(), PrepareTransaction(), PublicationAddTables(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForDropRelation(), RangeVarCallbackForLockTable(), RangeVarCallbackForPolicy(), RangeVarCallbackForReindexIndex(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackOwnsRelation(), RangeVarCallbackOwnsTable(), RangeVarGetAndCheckCreationNamespace(), ReassignOwnedObjects(), recomputeNamespacePath(), ReindexMultipleTables(), RemoveObjects(), RemoveRoleFromObjectPolicy(), renameatt_check(), RenameDatabase(), RenameSchema(), RenameTableSpace(), RenameType(), RevalidateCachedQuery(), RI_Initial_Check(), ri_ReportViolation(), sanity_check_relation(), select_perl_context(), set_foreign_rel_properties(), ShowAllGUCConfig(), statext_is_compatible_clause(), superuser(), TerminateOtherDBBackends(), transformTableLikeClause(), truncate_check_perms(), user_mapping_ddl_aclcheck(), vacuum_is_relation_owner(), ValidateJoinEstimator(), and ValidateRestrictionEstimator().
void GetUserIdAndSecContext | ( | Oid * | userid, |
int * | sec_context | ||
) |
Definition at line 581 of file miscinit.c.
References CurrentUserId, and SecurityRestrictionContext.
Referenced by CreateSchemaCommand(), do_analyze_rel(), ExecCreateTableAs(), ExecRefreshMatView(), execute_extension_script(), fmgr_security_definer(), index_build(), InitializeParallelDSM(), PushTransaction(), ri_PerformCheck(), ri_PlanCheck(), StartTransaction(), vacuum_rel(), and validate_index().
Definition at line 891 of file miscinit.c.
References AUTHOID, ereport, errcode(), errmsg(), ERROR, GETSTRUCT, HeapTupleIsValid, NameStr, ObjectIdGetDatum, pstrdup(), ReleaseSysCache(), rolname, and SearchSysCache1().
Referenced by check_is_member_of_role(), current_user(), execute_extension_script(), getObjectDescription(), getObjectIdentityParts(), insert_username(), regroleout(), RemoveRoleFromObjectPolicy(), and session_user().
Definition at line 657 of file miscinit.c.
References AUTHOID, GETSTRUCT, HeapTupleIsValid, ObjectIdGetDatum, ReleaseSysCache(), rolreplication, and SearchSysCache1().
Referenced by check_permissions(), and InitPostgres().
void InitializeSessionUserId | ( | const char * | rolename, |
Oid | roleid | ||
) |
Definition at line 675 of file miscinit.c.
References AcceptInvalidationMessages(), AssertState, AuthenticatedUserId, AuthenticatedUserIsSuperuser, AUTHNAME, AUTHOID, CountUserBackends(), ereport, errcode(), errmsg(), FATAL, GETSTRUCT, HeapTupleIsValid, IsBootstrapProcessingMode, IsUnderPostmaster, MyProc, NameStr, ObjectIdGetDatum, OidIsValid, PGC_BACKEND, PGC_INTERNAL, PGC_S_OVERRIDE, PointerGetDatum, ReleaseSysCache(), PGPROC::roleId, SearchSysCache1(), SetConfigOption(), and SetSessionUserId().
Referenced by InitPostgres().
void InitializeSessionUserIdStandalone | ( | void | ) |
Definition at line 778 of file miscinit.c.
References AssertState, AuthenticatedUserId, AuthenticatedUserIsSuperuser, IsAutoVacuumWorkerProcess(), IsBackgroundWorker, IsUnderPostmaster, OidIsValid, and SetSessionUserId().
Referenced by InitPostgres().
void InitPostmasterChild | ( | void | ) |
Definition at line 93 of file miscinit.c.
References BlockSig, elog, FATAL, InitializeLatchSupport(), InitializeLatchWaitSet(), InitLatch(), InitProcessGlobals(), IsUnderPostmaster, LocalLatchData, MyLatch, on_exit_reset(), PG_SETMASK, PostmasterDeathSignalInit(), pqinitmask(), pqsignal(), set_stack_base(), SignalHandlerForCrashExit(), and SIGQUIT.
Referenced by BackendRun(), BackendStartup(), do_start_bgworker(), pgarch_start(), pgstat_start(), StartAutoVacWorker(), StartChildProcess(), and SysLogger_Start().
void InitStandaloneProcess | ( | const char * | argv0 | ) |
Definition at line 165 of file miscinit.c.
References Assert, BlockSig, elog, FATAL, find_my_exec(), get_pkglib_path(), InitializeLatchSupport(), InitializeLatchWaitSet(), InitLatch(), InitProcessGlobals(), IsPostmasterEnvironment, LocalLatchData, my_exec_path, MyLatch, PG_SETMASK, pkglib_path, and pqinitmask().
Referenced by AuxiliaryProcessMain(), and PostgresMain().
bool InLocalUserIdChange | ( | void | ) |
Definition at line 599 of file miscinit.c.
References SECURITY_LOCAL_USERID_CHANGE, and SecurityRestrictionContext.
Referenced by GetUserIdAndContext(), is_admin_of_role(), and set_config_option().
bool InNoForceRLSOperation | ( | void | ) |
Definition at line 617 of file miscinit.c.
References SECURITY_NOFORCE_RLS, and SecurityRestrictionContext.
Referenced by check_enable_rls().
bool InSecurityRestrictedOperation | ( | void | ) |
Definition at line 608 of file miscinit.c.
References SECURITY_RESTRICTED_OPERATION, and SecurityRestrictionContext.
Referenced by afterTriggerMarkEvents(), CheckRestrictedOperation(), DefineRelation(), is_admin_of_role(), PerformCursorOpen(), set_config_option(), and SetUserIdAndContext().
|
static |
Definition at line 1605 of file miscinit.c.
References DEBUG1, ereport, errcode(), errmsg(), filename, first_dir_separator(), lfirst, list_free_deep(), load_file(), LOG, pfree(), psprintf(), pstrdup(), and SplitDirectoriesString().
Referenced by process_session_preload_libraries(), and process_shared_preload_libraries().
void pg_bindtextdomain | ( | const char * | domain | ) |
Definition at line 1681 of file miscinit.c.
References get_locale_path(), MAXPGPATH, and my_exec_path.
Referenced by _PG_init().
void process_session_preload_libraries | ( | void | ) |
Definition at line 1670 of file miscinit.c.
References load_libraries(), local_preload_libraries_string, and session_preload_libraries_string.
Referenced by PostgresMain().
void process_shared_preload_libraries | ( | void | ) |
Definition at line 1657 of file miscinit.c.
References load_libraries(), process_shared_preload_libraries_in_progress, and shared_preload_libraries_string.
Referenced by BackendRun(), and PostmasterMain().
bool RecheckDataDirLockFile | ( | void | ) |
Definition at line 1456 of file miscinit.c.
References close, DIRECTORY_LOCK_FILE, ereport, errcode_for_file_access(), errmsg(), fd(), LOG, PG_BINARY, pgstat_report_wait_end(), pgstat_report_wait_start(), read, and WAIT_EVENT_LOCK_FILE_RECHECKDATADIR_READ.
Referenced by ServerLoop().
Definition at line 856 of file miscinit.c.
References OidIsValid, PGC_INTERNAL, PGC_S_OVERRIDE, SessionUserId, SessionUserIsSuperuser, SetConfigOption(), SetOuterUserId(), and SetRoleIsActive.
Referenced by assign_role(), and ParallelWorkerMain().
void SetDatabasePath | ( | const char * | path | ) |
Definition at line 289 of file miscinit.c.
References Assert, DatabasePath, MemoryContextStrdup(), and TopMemoryContext.
Referenced by InitPostgres().
void SetDataDir | ( | const char * | dir | ) |
Definition at line 395 of file miscinit.c.
References AssertArg, DataDir, free, and make_absolute_path().
Referenced by PostmasterMarkPIDForWorkerNotify(), and SelectConfigFiles().
|
static |
Definition at line 495 of file miscinit.c.
References AssertArg, AssertState, CurrentUserId, OidIsValid, OuterUserId, and SecurityRestrictionContext.
Referenced by SetCurrentRoleId().
Definition at line 810 of file miscinit.c.
References AssertState, AuthenticatedUserId, AuthenticatedUserIsSuperuser, ereport, errcode(), errmsg(), ERROR, OidIsValid, PGC_INTERNAL, PGC_S_OVERRIDE, SetConfigOption(), and SetSessionUserId().
Referenced by assign_session_authorization().
Definition at line 518 of file miscinit.c.
References AssertArg, AssertState, CurrentUserId, is_superuser(), OidIsValid, OuterUserId, SecurityRestrictionContext, SessionUserId, SessionUserIsSuperuser, and SetRoleIsActive.
Referenced by InitializeSessionUserId(), InitializeSessionUserIdStandalone(), and SetSessionAuthorization().
Definition at line 637 of file miscinit.c.
References CurrentUserId, ereport, errcode(), errmsg(), ERROR, InSecurityRestrictedOperation(), SECURITY_LOCAL_USERID_CHANGE, and SecurityRestrictionContext.
void SetUserIdAndSecContext | ( | Oid | userid, |
int | sec_context | ||
) |
Definition at line 588 of file miscinit.c.
References CurrentUserId, and SecurityRestrictionContext.
Referenced by AbortSubTransaction(), AbortTransaction(), CreateSchemaCommand(), do_analyze_rel(), ExecCreateTableAs(), ExecRefreshMatView(), execute_extension_script(), fmgr_security_definer(), index_build(), ParallelWorkerMain(), refresh_by_match_merge(), ri_PerformCheck(), ri_PlanCheck(), vacuum_rel(), and validate_index().
void SwitchBackToLocalLatch | ( | void | ) |
Definition at line 216 of file miscinit.c.
References Assert, FeBeWaitSet, LocalLatchData, ModifyWaitEvent(), MyLatch, MyProc, PGPROC::procLatch, SetLatch(), and WL_LATCH_SET.
Referenced by AuxiliaryProcKill(), and ProcKill().
void SwitchToSharedLatch | ( | void | ) |
Definition at line 197 of file miscinit.c.
References Assert, FeBeWaitSet, ModifyWaitEvent(), MyLatch, MyProc, PGPROC::procLatch, SetLatch(), and WL_LATCH_SET.
Referenced by InitAuxiliaryProcess(), and InitProcess().
void TouchSocketLockFiles | ( | void | ) |
Definition at line 1300 of file miscinit.c.
References DIRECTORY_LOCK_FILE, and lfirst.
Referenced by ServerLoop().
|
static |
Definition at line 933 of file miscinit.c.
References ereport, errmsg(), IsPostmasterEnvironment, lfirst, LOG, NIL, and NOTICE.
Referenced by CreateLockFile().
void ValidatePgVersion | ( | const char * | path | ) |
Definition at line 1528 of file miscinit.c.
References AllocateFile(), ereport, errcode(), errcode_for_file_access(), errdetail(), errhint(), errmsg(), FATAL, FreeFile(), MAXPGPATH, and snprintf.
Referenced by checkDataDir(), and InitPostgres().
|
static |
Definition at line 456 of file miscinit.c.
Referenced by GetAuthenticatedUserId(), InitializeSessionUserId(), InitializeSessionUserIdStandalone(), and SetSessionAuthorization().
Definition at line 462 of file miscinit.c.
Referenced by InitializeSessionUserId(), InitializeSessionUserIdStandalone(), and SetSessionAuthorization().
|
static |
Definition at line 459 of file miscinit.c.
Referenced by GetUserId(), GetUserIdAndContext(), GetUserIdAndSecContext(), SetOuterUserId(), SetSessionUserId(), SetUserIdAndContext(), and SetUserIdAndSecContext().
Definition at line 79 of file miscinit.c.
Referenced by AuxiliaryProcessMain(), get_relation_info(), systable_beginscan(), and systable_beginscan_ordered().
char* local_preload_libraries_string = NULL |
Definition at line 1593 of file miscinit.c.
Referenced by process_session_preload_libraries().
|
static |
Definition at line 67 of file miscinit.c.
Referenced by InitPostmasterChild(), InitStandaloneProcess(), and SwitchBackToLocalLatch().
Definition at line 65 of file miscinit.c.
ProcessingMode Mode = InitProcessing |
Definition at line 60 of file miscinit.c.
BackendType MyBackendType |
Definition at line 62 of file miscinit.c.
Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), AuxiliaryProcessMain(), init_ps_display(), log_line_prefix(), PgArchiverMain(), pgstat_bestart(), pgstat_report_stat(), PgstatCollectorMain(), ProcessStartupPacket(), send_message_to_server_log(), StartBackgroundWorker(), SysLoggerMain(), and write_csvlog().
|
static |
Definition at line 458 of file miscinit.c.
Referenced by GetCurrentRoleId(), GetOuterUserId(), SetOuterUserId(), and SetSessionUserId().
Definition at line 1596 of file miscinit.c.
Referenced by _PG_init(), apw_start_leader_worker(), init_custom_variable(), process_shared_preload_libraries(), and RegisterBackgroundWorker().
|
static |
Definition at line 465 of file miscinit.c.
Referenced by GetUserIdAndSecContext(), InLocalUserIdChange(), InNoForceRLSOperation(), InSecurityRestrictedOperation(), SetOuterUserId(), SetSessionUserId(), SetUserIdAndContext(), and SetUserIdAndSecContext().
char* session_preload_libraries_string = NULL |
Definition at line 1591 of file miscinit.c.
Referenced by process_session_preload_libraries().
|
static |
Definition at line 457 of file miscinit.c.
Referenced by GetSessionUserId(), SetCurrentRoleId(), and SetSessionUserId().
Definition at line 463 of file miscinit.c.
Referenced by SetCurrentRoleId(), and SetSessionUserId().
Definition at line 468 of file miscinit.c.
Referenced by GetCurrentRoleId(), SetCurrentRoleId(), and SetSessionUserId().
char* shared_preload_libraries_string = NULL |
Definition at line 1592 of file miscinit.c.
Referenced by process_shared_preload_libraries().