This patch fixes shared_preload_libraries on Windows hosts. It forces
authorBruce Momjian <bruce@momjian.us>
Thu, 8 Feb 2007 15:46:04 +0000 (15:46 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 8 Feb 2007 15:46:04 +0000 (15:46 +0000)
ach backend to re-load all shared_preload_libraries.

Korry Douglas

doc/src/sgml/config.sgml
src/backend/postmaster/postmaster.c

index a33e898d3d0f6272787dbcba84202e5a162d64c3..8932badda5253b623f033b0ce0a387e1a99b0a06 100644 (file)
@@ -990,6 +990,17 @@ SET ENABLE_SEQSCAN TO OFF;
         libraries that will be used in most sessions. 
        </para>
 
+     <note>
+      <para>
+        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, <varname>shared_preload_libraries
+        </varname> 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).
+       </para>
+      </note>
        <para>
         If a specified library is not found,
         the server will fail to start.
index a7bed64ec98916eecb03cfaf60a8894bdaa4aef0..ab2ca765f4dbad8b6428395682a4ffd6e0ea241b 100644 (file)
@@ -3360,6 +3360,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.
                 *