{"Entry":{"collection":"hook","key":"shmem_startup_hook","name":"shmem_startup_hook","aliases":[],"metadata":{"aliases":[],"category":"Startup and shared memory","content_hash":"ebe8d9817c2337f6f1564f254f021f50ffd04f903a37d58eeee6956e9f8acaab","derived_content_hash":"f217c60d23b755422575db9dd4253c07f72501acfc8f0608f6e7f43afde23193","imported_at":"2026-09-30T17:44:22.45807+08:00","name":"shmem_startup_hook","name_zh":"shmem_startup_hook","repair_provenance":{"original_source_revision":"","receipt_sha256":"94f9eb6440b57a97e8afe57803ba16cc41f9434649396a3252f8a51cdecbc05d","repair":"wiki-repair-20261023"},"slug":"shmem_startup_hook","source_rev":"wiki-repair-20261023:19f063db728f43b3bbc400d84ae268f200517877c6314bbe2f8c0b52926c927b","summary":"Now give loadable modules a chance to set up their shmem allocations"}},"Definition":{"Collection":"hook","Key":"shmem_startup_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"shmem_startup_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Now give loadable modules a chance to set up their shmem allocations"],"description_zh":"此时允许可加载模块设置其共享内存分配。","description_zh_html":"\u003cp\u003e此时允许可加载模块设置其共享内存分配。\u003c/p\u003e\u003cp\u003e以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。\u003c/p\u003e\u003ch3\u003e接口声明\u003c/h3\u003e\u003cpre\u003etypedef void (*shmem_startup_hook_type) (void);\nextern PGDLLIMPORT shmem_startup_hook_type shmem_startup_hook;\u003c/pre\u003e\u003ch3\u003e调用位置\u003c/h3\u003e\u003cul\u003e\u003cli\u003e\u003ccode\u003esrc/backend/storage/ipc/ipci.c:191\u003c/code\u003e\u003c/li\u003e\u003cli\u003e\u003ccode\u003esrc/backend/storage/ipc/ipci.c:249\u003c/code\u003e\u003c/li\u003e\u003c/ul\u003e\u003ch3\u003e核心调用上下文：src/backend/storage/ipc/ipci.c:185–199\u003c/h3\u003e\u003cpre\u003e\tCreateOrAttachShmemStructs();\n\n\t/*\n\t * Now give loadable modules a chance to set up their shmem allocations\n\t */\n\tif (shmem_startup_hook)\n\t\tshmem_startup_hook();\n}\n#endif\n\n/*\n * CreateSharedMemoryAndSemaphores\n *\t\tCreates and initializes shared memory and semaphores.\n */\nvoid\u003c/pre\u003e\u003ch3\u003e核心调用上下文：src/backend/storage/ipc/ipci.c:243–257\u003c/h3\u003e\u003cpre\u003e\tdsm_postmaster_startup(shim);\n\n\t/*\n\t * Now give loadable modules a chance to set up their shmem allocations\n\t */\n\tif (shmem_startup_hook)\n\t\tshmem_startup_hook();\n}\n\n/*\n * Initialize various subsystems, setting up their data structures in\n * shared memory.\n *\n * This is called by the postmaster or by a standalone backend.\n * It is also called by a backend forked from the postmaster in the\u003c/pre\u003e","facts":[{"label":"Interface type","value":"shmem_startup_hook_type"},{"label":"Header","value":"src/include/storage/ipc.h"},{"label":"Subsystem","value":"Startup and shared memory"},{"label":"Initial value","value":"NULL (no hook installed)"}],"related":[{"label":"shared_preload_libraries","url":"/wiki/guc/shared_preload_libraries/?v=18"}],"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sections":[{"paragraphs":["src/backend/storage/ipc/ipci.c:191","src/backend/storage/ipc/ipci.c:249"],"title":"Call sites"},{"code":"\tCreateOrAttachShmemStructs();\n\n\t/*\n\t * Now give loadable modules a chance to set up their shmem allocations\n\t */\n\tif (shmem_startup_hook)\n\t\tshmem_startup_hook();\n}\n#endif\n\n/*\n * CreateSharedMemoryAndSemaphores\n *\t\tCreates and initializes shared memory and semaphores.\n */\nvoid","paragraphs":[],"title":"Core call context: src/backend/storage/ipc/ipci.c:185–199"},{"code":"\tdsm_postmaster_startup(shim);\n\n\t/*\n\t * Now give loadable modules a chance to set up their shmem allocations\n\t */\n\tif (shmem_startup_hook)\n\t\tshmem_startup_hook();\n}\n\n/*\n * Initialize various subsystems, setting up their data structures in\n * shared memory.\n *\n * This is called by the postmaster or by a standalone backend.\n * It is also called by a backend forked from the postmaster in the","paragraphs":[],"title":"Core call context: src/backend/storage/ipc/ipci.c:243–257"}],"signature":"typedef void (*shmem_startup_hook_type) (void);\nextern PGDLLIMPORT shmem_startup_hook_type shmem_startup_hook;","sources":[{"label":"Interface declaration","path":"src/include/storage/ipc.h","sha256":"7eaed5df20e9c94832bf72b758512f55113d727b3cfc426cf7642b2a8ca89334","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/storage/ipc.h#L22"},{"label":"Core definition","path":"src/backend/storage/ipc/ipci.c","sha256":"2fa09c75851a35bfb974c97e64f82505e236e56cf480ded7ed7a632cec39d77c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/storage/ipc/ipci.c#L58"},{"label":"Call sites","path":"src/backend/storage/ipc/ipci.c","sha256":"2fa09c75851a35bfb974c97e64f82505e236e56cf480ded7ed7a632cec39d77c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/storage/ipc/ipci.c#L191"}],"translation_provenance":{"inputs":[{"label":"Interface declaration","path":"src/include/storage/ipc.h","sha256":"7eaed5df20e9c94832bf72b758512f55113d727b3cfc426cf7642b2a8ca89334","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/storage/ipc.h#L22"},{"label":"Core definition","path":"src/backend/storage/ipc/ipci.c","sha256":"2fa09c75851a35bfb974c97e64f82505e236e56cf480ded7ed7a632cec39d77c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/storage/ipc/ipci.c#L58"},{"label":"Call sites","path":"src/backend/storage/ipc/ipci.c","sha256":"2fa09c75851a35bfb974c97e64f82505e236e56cf480ded7ed7a632cec39d77c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/storage/ipc/ipci.c#L191"}],"kind":"authored-source-translation","locale":"zh-Hans","source_revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","translated_source_sha256":"9d9333a2c76454a236ba83b43b2b279d9df598a85bbcb8bb853f721b00798748","version":"18"},"zh_from":"authored-source-translation"},"ManualEvidence":{"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sources":[{"label":"Interface declaration","path":"src/include/storage/ipc.h","sha256":"7eaed5df20e9c94832bf72b758512f55113d727b3cfc426cf7642b2a8ca89334","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/storage/ipc.h#L22"},{"label":"Core definition","path":"src/backend/storage/ipc/ipci.c","sha256":"2fa09c75851a35bfb974c97e64f82505e236e56cf480ded7ed7a632cec39d77c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/storage/ipc/ipci.c#L58"},{"label":"Call sites","path":"src/backend/storage/ipc/ipci.c","sha256":"2fa09c75851a35bfb974c97e64f82505e236e56cf480ded7ed7a632cec39d77c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/storage/ipc/ipci.c#L191"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"shmem_startup_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"shmem_startup_hook","Summary":"Now give loadable modules a chance to set up their shmem allocations","BodyHTML":"\u003cp\u003eNow give loadable modules a chance to set up their shmem allocations\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"535836f13dfb95ea1b08f58f50abffd58b5b5816a5eefd11324526d05073b656","Payload":{"description":["Now give loadable modules a chance to set up their shmem allocations"],"related":[{"label":"shared_preload_libraries","url":"/wiki/guc/shared_preload_libraries/?v=18"}],"sections":[{"paragraphs":["src/backend/storage/ipc/ipci.c:191","src/backend/storage/ipc/ipci.c:249"],"title":"Call sites"},{"code":"\tCreateOrAttachShmemStructs();\n\n\t/*\n\t * Now give loadable modules a chance to set up their shmem allocations\n\t */\n\tif (shmem_startup_hook)\n\t\tshmem_startup_hook();\n}\n#endif\n\n/*\n * CreateSharedMemoryAndSemaphores\n *\t\tCreates and initializes shared memory and semaphores.\n */\nvoid","paragraphs":[],"title":"Core call context: src/backend/storage/ipc/ipci.c:185–199"},{"code":"\tdsm_postmaster_startup(shim);\n\n\t/*\n\t * Now give loadable modules a chance to set up their shmem allocations\n\t */\n\tif (shmem_startup_hook)\n\t\tshmem_startup_hook();\n}\n\n/*\n * Initialize various subsystems, setting up their data structures in\n * shared memory.\n *\n * This is called by the postmaster or by a standalone backend.\n * It is also called by a backend forked from the postmaster in the","paragraphs":[],"title":"Core call context: src/backend/storage/ipc/ipci.c:243–257"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
