|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <ctype.h>#include <fcntl.h>#include <unistd.h>#include "access/genam.h"#include "access/heapam.h"#include "access/htup_details.h"#include "access/session.h"#include "access/tableam.h"#include "access/xact.h"#include "access/xlog.h"#include "access/xloginsert.h"#include "catalog/namespace.h"#include "catalog/pg_authid.h"#include "catalog/pg_collation.h"#include "catalog/pg_database.h"#include "catalog/pg_db_role_setting.h"#include "catalog/pg_tablespace.h"#include "libpq/auth.h"#include "libpq/libpq-be.h"#include "mb/pg_wchar.h"#include "miscadmin.h"#include "pgstat.h"#include "postmaster/autovacuum.h"#include "postmaster/postmaster.h"#include "replication/slot.h"#include "replication/slotsync.h"#include "replication/walsender.h"#include "storage/aio_subsys.h"#include "storage/bufmgr.h"#include "storage/fd.h"#include "storage/ipc.h"#include "storage/lmgr.h"#include "storage/proc.h"#include "storage/procarray.h"#include "storage/procnumber.h"#include "storage/procsignal.h"#include "storage/sinvaladt.h"#include "storage/smgr.h"#include "storage/sync.h"#include "tcop/backend_startup.h"#include "tcop/tcopprot.h"#include "utils/acl.h"#include "utils/builtins.h"#include "utils/fmgroids.h"#include "utils/guc_hooks.h"#include "utils/injection_point.h"#include "utils/memutils.h"#include "utils/pg_locale.h"#include "utils/portal.h"#include "utils/ps_status.h"#include "utils/snapmgr.h"#include "utils/syscache.h"#include "utils/timeout.h"
Go to the source code of this file.
Variables | |
| static bool | ConnectionWarningsEmitted |
| static List * | ConnectionWarningMessages |
| static List * | ConnectionWarningDetails |
Definition at line 615 of file postinit.c.
References Assert, DebugFileOpen(), fb(), InitBufferManagerAccess(), InitFileAccess(), InitializeProcessXLogLogicalInfo(), InitLockManagerAccess(), InitSync(), InitTemporaryFileAccess(), InitXLogInsert(), MyProc, pgaio_init_backend(), pgstat_initialize(), ReplicationSlotInitialize(), and smgrinit().
Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), AuxiliaryProcessMainCommon(), BackgroundWorkerMain(), BootstrapModeMain(), PostgresMain(), and ReplSlotSyncWorkerMain().
|
static |
Definition at line 331 of file postinit.c.
References ACL_CONNECT, ACLCHECK_OK, AmRegularBackendProcess, CountDBConnections(), elog, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, FATAL, fb(), Form_pg_database, get_collation_actual_version(), GetDatabaseEncodingName(), GETSTRUCT(), GetUserId(), HeapTupleIsValid, init_database_collation(), IsUnderPostmaster, MyDatabaseId, name, NameStr, object_aclcheck(), ObjectIdGetDatum(), pg_perm_setlocale(), PGC_BACKEND, PGC_INTERNAL, PGC_S_DYNAMIC_DEFAULT, quote_identifier(), ReleaseSysCache(), SearchSysCache1(), SetConfigOption(), SetDatabaseEncoding(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), TextDatumGetCString, and WARNING.
Referenced by InitPostgres().
Definition at line 1436 of file postinit.c.
References CheckClientConnectionPending, InterruptPending, MyLatch, and SetLatch().
Referenced by InitPostgres().
Definition at line 1497 of file postinit.c.
References ConnectionWarningDetails, ConnectionWarningMessages, ConnectionWarningsEmitted, elog, ereport, errdetail(), errmsg(), ERROR, fb(), forboth, lfirst, list_free_deep(), and WARNING.
Referenced by InitPostgres().
Definition at line 113 of file postinit.c.
References AccessShareLock, BTEqualStrategyNumber, criticalSharedRelcachesBuilt, CStringGetDatum(), dbname, fb(), heap_copytuple(), HeapTupleIsValid, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by InitPostgres().
Definition at line 156 of file postinit.c.
References AccessShareLock, BTEqualStrategyNumber, criticalSharedRelcachesBuilt, fb(), heap_copytuple(), HeapTupleIsValid, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by InitPostgres().
Definition at line 1412 of file postinit.c.
References IdleInTransactionSessionTimeoutPending, InterruptPending, MyLatch, and SetLatch().
Referenced by InitPostgres().
Definition at line 1420 of file postinit.c.
References IdleSessionTimeoutPending, InterruptPending, MyLatch, and SetLatch().
Referenced by InitPostgres().
Definition at line 1428 of file postinit.c.
References IdleStatsUpdateTimeoutPending, InterruptPending, MyLatch, and SetLatch().
Referenced by InitPostgres().
Definition at line 583 of file postinit.c.
References Assert, FastPathLockGroupsPerBackend, FP_LOCK_GROUPS_PER_BACKEND_MAX, FP_LOCK_SLOTS_PER_GROUP, Max, max_locks_per_xact, Min, and pg_nextpower2_32().
Referenced by BootstrapModeMain(), PostgresSingleUserMain(), and PostmasterMain().
Definition at line 558 of file postinit.c.
References Assert, autovacuum_worker_slots, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), MAX_BACKENDS, max_wal_senders, max_worker_processes, MaxBackends, MaxConnections, and NUM_SPECIAL_WORKER_PROCS.
Referenced by BootstrapModeMain(), PostgresSingleUserMain(), and PostmasterMain().
| void InitPostgres | ( | const char * | in_dbname, |
| Oid | dboid, | ||
| const char * | username, | ||
| Oid | useroid, | ||
| bits32 | flags, | ||
| char * | out_dbname | ||
| ) |
Definition at line 718 of file postinit.c.
References am_db_walsender, am_walsender, AmAutoVacuumLauncherProcess, AmAutoVacuumWorkerProcess, AmBackgroundWorkerProcess, AmLogicalSlotSyncWorkerProcess, AmRegularBackendProcess, Assert, ClientConnectionInfo::auth_method, ClientConnectionInfo::authn_id, before_shmem_exit(), CheckDeadLockAlert(), CheckMyDatabase(), CLIENT_CONNECTION_CHECK_TIMEOUT, ClientCheckTimeoutHandler(), CommitTransactionCommand(), CreateAuxProcessResourceOwner(), CurrentResourceOwner, database_is_invalid_form(), PGPROC::databaseId, dbname, DEADLOCK_TIMEOUT, DEBUG3, elog, EmitConnectionWarnings(), EnablePortalManager(), ereport, errcode(), errcode_for_file_access(), errdetail(), errhint(), errmsg(), FATAL, fb(), Form_pg_database, GetDatabasePath(), GetDatabaseTuple(), GetDatabaseTupleByOid(), GetSessionUserId(), GETSTRUCT(), GetUserId(), has_privs_of_role(), has_rolreplication(), HaveNFreeProcs(), hba_authname(), HeapTupleIsValid, IDLE_IN_TRANSACTION_SESSION_TIMEOUT, IDLE_SESSION_TIMEOUT, IDLE_STATS_UPDATE_TIMEOUT, IdleInTransactionSessionTimeoutHandler(), IdleSessionTimeoutHandler(), IdleStatsUpdateTimeoutHandler(), INIT_PG_LOAD_SESSION_LIBS, INIT_PG_OVERRIDE_ALLOW_CONNS, INIT_PG_OVERRIDE_ROLE_LOGIN, InitCatalogCache(), initialize_acl(), InitializeClientEncoding(), InitializeSearchPath(), InitializeSession(), InitializeSessionUserId(), InitializeSessionUserIdStandalone(), InitializeSystemUser(), InitPlanCache(), InitProcessPhase2(), INJECTION_POINT, InvalidateCatalogSnapshot(), IsBinaryUpgrade, IsBootstrapProcessingMode, IsUnderPostmaster, LOCK_TIMEOUT, LockSharedObject(), LockTimeoutHandler(), MyCancelKey, MyCancelKeyLength, MyClientConnectionInfo, MyDatabaseHasLoginEventTriggers, MyDatabaseId, MyDatabaseTableSpace, MyProc, MyProcPort, NAMEDATALEN, NameStr, namestrcmp(), OidIsValid, PerformAuthentication(), pfree(), pg_usleep(), pgstat_before_server_shutdown(), pgstat_beinit(), pgstat_bestart_final(), pgstat_bestart_initial(), pgstat_bestart_security(), PostAuthDelay, process_session_preload_libraries(), process_settings(), process_startup_options(), ProcSignalInit(), RegisterTimeout(), RelationCacheInitialize(), RelationCacheInitializePhase2(), RelationCacheInitializePhase3(), ReleaseAuxProcessResources(), ReservedConnections, RowExclusiveLock, SetCurrentStatementStartTimestamp(), SetDatabasePath(), SharedInvalBackendInit(), ShutdownPostgres(), ShutdownXLOG(), StartTransactionCommand(), StartupXLOG(), STATEMENT_TIMEOUT, StatementTimeoutHandler(), strlcpy(), superuser(), SuperuserReservedConnections, ThereIsAtLeastOneRole(), TRANSACTION_TIMEOUT, TransactionTimeoutHandler(), username, ValidatePgVersion(), WARNING, XACT_READ_COMMITTED, and XactIsoLevel.
Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), BackgroundWorkerInitializeConnection(), BackgroundWorkerInitializeConnectionByOid(), BootstrapModeMain(), PostgresMain(), and ReplSlotSyncWorkerMain().
Definition at line 1394 of file postinit.c.
References fb(), kill, and MyProcPid.
Referenced by InitPostgres().
Definition at line 202 of file postinit.c.
References _, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, am_walsender, appendStringInfo(), ConnectionTiming::auth_end, ConnectionTiming::auth_start, AuthenticationTimeout, be_gssapi_get_auth(), be_gssapi_get_delegation(), be_gssapi_get_enc(), be_gssapi_get_princ(), be_tls_get_cipher(), be_tls_get_cipher_bits(), be_tls_get_version(), ClientAuthentication(), ClientAuthInProgress, conn_timing, disable_timeout(), enable_timeout_after(), ereport, errmsg(), errmsg_internal(), FATAL, fb(), GetCurrentTimestamp(), HbaFileName, initStringInfo(), load_hba(), load_ident(), LOG, LOG_CONNECTION_AUTHORIZATION, log_connections, pfree(), port, PostmasterContext, set_ps_display(), STATEMENT_TIMEOUT, and TopMemoryContext.
Referenced by InitPostgres().
Definition at line 500 of file postinit.c.
References appendStringInfoChar(), StringInfoData::data, fb(), initStringInfo(), pfree(), pstrdup(), and resetStringInfo().
Referenced by process_startup_options().
Definition at line 1321 of file postinit.c.
References AccessShareLock, ApplySetting(), fb(), GetCatalogSnapshot(), InvalidOid, IsUnderPostmaster, PGC_S_DATABASE, PGC_S_DATABASE_USER, PGC_S_GLOBAL, PGC_S_USER, RegisterSnapshot(), table_close(), table_open(), and UnregisterSnapshot().
Referenced by InitPostgres().
Definition at line 1256 of file postinit.c.
References Assert, av, fb(), lfirst, list_head(), lnext(), name, palloc_array, pg_split_opts(), PGC_BACKEND, PGC_S_CLIENT, PGC_SU_BACKEND, port, process_postgres_switches(), SetConfigOption(), and value.
Referenced by InitPostgres().
Definition at line 1355 of file postinit.c.
References AbortOutOfAnyTransaction(), LockReleaseAll(), and USER_LOCKMETHOD.
Referenced by InitPostgres().
Definition at line 1372 of file postinit.c.
References ClientAuthInProgress, fb(), kill, MyProcPid, and sig.
Referenced by InitPostgres().
Definition at line 1472 of file postinit.c.
References Assert, ConnectionWarningDetails, ConnectionWarningMessages, ConnectionWarningsEmitted, elog, ERROR, lappend(), MemoryContextSwitchTo(), and TopMemoryContext.
Referenced by get_role_password(), and md5_crypt_verify().
Definition at line 1447 of file postinit.c.
References AccessShareLock, fb(), ForwardScanDirection, heap_getnext(), table_beginscan_catalog(), table_close(), table_endscan(), and table_open().
Referenced by InitPostgres().
Definition at line 1404 of file postinit.c.
References InterruptPending, MyLatch, SetLatch(), and TransactionTimeoutPending.
Referenced by InitPostgres().
|
static |
Definition at line 78 of file postinit.c.
Referenced by EmitConnectionWarnings(), and StoreConnectionWarning().
|
static |
Definition at line 77 of file postinit.c.
Referenced by EmitConnectionWarnings(), and StoreConnectionWarning().
|
static |
Definition at line 74 of file postinit.c.
Referenced by EmitConnectionWarnings(), and StoreConnectionWarning().