From bcc1d6f3b35a514d7488608282ed4b1badd277ba Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Mon, 15 Jun 2026 22:53:43 +0000 Subject: [PATCH] Register built-in dynamic managers in EXEC_BACKEND child Under EXEC_BACKEND the exec'd child starts with an empty (palloc'd) smgr table; register_builtin_dynamic_managers() is only called from the postmaster (inherited via fork) and InitStandaloneProcess. Re-run it in SubPostmasterMain, before process_shared_preload_libraries(), mirroring the postmaster so extensions can still register their own smgrs. --- src/backend/postmaster/launch_backend.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backend/postmaster/launch_backend.c b/src/backend/postmaster/launch_backend.c index d23aed237d2cf..662ac885b9d80 100644 --- a/src/backend/postmaster/launch_backend.c +++ b/src/backend/postmaster/launch_backend.c @@ -661,6 +661,15 @@ SubPostmasterMain(int argc, char *argv[]) */ LocalProcessControlFile(false); + /* + * Re-register built-in dynamic managers (e.g. md smgr). On fork-based + * platforms the child inherits the postmaster's already-populated smgr + * table; under EXEC_BACKEND the child starts with an empty table, so we + * must re-run registration. Must happen before shared_preload_libraries + * so extensions can still register their own smgrs from _PG_init(). + */ + register_builtin_dynamic_managers(); + /* * Reload any libraries that were preloaded by the postmaster. Since we * exec'd this process, those libraries didn't come along with us; but we