|
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 "port/pg_bitutils.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.
Data Structures | |
| struct | ConnectionWarning |
Typedefs | |
| typedef struct ConnectionWarning | ConnectionWarning |
Variables | |
| static bool | ConnectionWarningsEmitted |
| static List * | ConnectionWarnings |
Definition at line 622 of file postinit.c.
References Assert, DebugFileOpen(), fb(), InitBufferManagerAccess(), InitFileAccess(), 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 338 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 1478 of file postinit.c.
References CheckClientConnectionPending, InterruptPending, MyLatch, and SetLatch().
Referenced by InitPostgres().
Definition at line 1546 of file postinit.c.
References ConnectionWarnings, ConnectionWarningsEmitted, elog, ereport, errdetail(), errmsg, ERROR, fb(), foreach_ptr, list_free(), NIL, pfree(), WARNING, and warning().
Referenced by InitPostgres().
Definition at line 120 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 163 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 1454 of file postinit.c.
References IdleInTransactionSessionTimeoutPending, InterruptPending, MyLatch, and SetLatch().
Referenced by InitPostgres().
Definition at line 1462 of file postinit.c.
References IdleSessionTimeoutPending, InterruptPending, MyLatch, and SetLatch().
Referenced by InitPostgres().
Definition at line 1470 of file postinit.c.
References IdleStatsUpdateTimeoutPending, InterruptPending, MyLatch, and SetLatch().
Referenced by InitPostgres().
Definition at line 590 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 565 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, | ||
| uint32 | flags, | ||
| char * | out_dbname | ||
| ) |
Definition at line 722 of file postinit.c.
References am_db_walsender, am_walsender, AmAutoVacuumLauncherProcess, AmAutoVacuumWorkerProcess, AmBackgroundWorkerProcess, AmDataChecksumsWorkerProcess, 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, HOLD_INTERRUPTS, 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(), InitializeProcessXLogLogicalInfo(), InitializeSearchPath(), InitializeSession(), InitializeSessionUserId(), InitializeSessionUserIdStandalone(), InitializeSystemUser(), InitLocalDataChecksumState(), 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, RESUME_INTERRUPTS, 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 1436 of file postinit.c.
References fb(), kill, and MyProcPid.
Referenced by InitPostgres().
Definition at line 209 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 507 of file postinit.c.
References appendStringInfoChar(), StringInfoData::data, fb(), initStringInfo(), pfree(), pstrdup(), and resetStringInfo().
Referenced by process_startup_options().
Definition at line 1363 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 1298 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 1397 of file postinit.c.
References AbortOutOfAnyTransaction(), LockReleaseAll(), and USER_LOCKMETHOD.
Referenced by InitPostgres().
Definition at line 1414 of file postinit.c.
References ClientAuthInProgress, fb(), kill, MyProcPid, and sig.
Referenced by InitPostgres().
| void StoreConnectionWarning | ( | char * | msg, |
| char * | detail, | ||
| ConnectionWarningFilter | filter | ||
| ) |
Definition at line 1517 of file postinit.c.
References Assert, ConnectionWarnings, ConnectionWarningsEmitted, elog, ERROR, lappend(), MemoryContextSwitchTo(), palloc_object, TopMemoryContext, and warning().
Referenced by get_role_password(), and md5_crypt_verify().
Definition at line 1489 of file postinit.c.
References AccessShareLock, fb(), ForwardScanDirection, heap_getnext(), result, table_beginscan_catalog(), table_close(), table_endscan(), and table_open().
Referenced by InitPostgres().
Definition at line 1446 of file postinit.c.
References InterruptPending, MyLatch, SetLatch(), and TransactionTimeoutPending.
Referenced by InitPostgres().
|
static |
Definition at line 85 of file postinit.c.
Referenced by EmitConnectionWarnings(), and StoreConnectionWarning().
|
static |
Definition at line 75 of file postinit.c.
Referenced by EmitConnectionWarnings(), and StoreConnectionWarning().