From: Bruce Momjian Date: Thu, 8 Feb 2007 17:04:48 +0000 (+0000) Subject: This patch fixes shared_preload_libraries on Windows hosts. It forces X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=18bce4888a45c75863108b58312d680369f6e932;p=users%2Fbernd%2Fpostgres.git This patch fixes shared_preload_libraries on Windows hosts. It forces each backend to re-load all shared_preload_libraries. Backpatch to 8.2.X. Korry Douglas --- diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index f8fa9c3c23..81f9bd3f27 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -990,6 +990,17 @@ SET ENABLE_SEQSCAN TO OFF; libraries that will be used in most sessions. + + + On Windows hosts, preloading a library at server start will not reduce + the time required to start each new server process; each server process + will re-load all preload libraries. However, shared_preload_libraries + is still useful on Windows hosts because some shared libraries may + need to perform certain operations that only take place at postmaster start + (for example, a shared library may need to reserve lightweight locks + or shared memory and you can't do that after the postmaster has started). + + If a specified library is not found, the server will fail to start. diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 82e6a5e11e..dd00cd69ab 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -3332,6 +3332,15 @@ SubPostmasterMain(int argc, char *argv[]) secure_initialize(); #endif + /* + * process any libraries that should be preloaded at postmaster start + * + * NOTE: we have to re-load the shared_preload_libraries here because + * this backend is not fork()ed so we can't inherit any shared + * libraries / DLL's from our parent (the postmaster). + */ + process_shared_preload_libraries(); + /* * Perform additional initialization and client authentication. *