Skip to content

Commit a37b006

Browse files
committed
This patch fixes shared_preload_libraries on Windows hosts. It forces
ach backend to re-load all shared_preload_libraries. Korry Douglas
1 parent eea3749 commit a37b006

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

doc/src/sgml/config.sgml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.109 2007/02/08 03:56:42 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.110 2007/02/08 15:46:03 momjian Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -990,6 +990,17 @@ SET ENABLE_SEQSCAN TO OFF;
990990
libraries that will be used in most sessions.
991991
</para>
992992

993+
<note>
994+
<para>
995+
On Windows hosts, preloading a library at server start will not reduce
996+
the time required to start each new server process; each server process
997+
will re-load all preload libraries. However, <varname>shared_preload_libraries
998+
</varname> is still useful on Windows hosts because some shared libraries may
999+
need to perform certain operations that only take place at postmaster start
1000+
(for example, a shared library may need to reserve lightweight locks
1001+
or shared memory and you can't do that after the postmaster has started).
1002+
</para>
1003+
</note>
9931004
<para>
9941005
If a specified library is not found,
9951006
the server will fail to start.

src/backend/postmaster/postmaster.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.517 2007/02/07 16:44:48 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.518 2007/02/08 15:46:04 momjian Exp $
4141
*
4242
* NOTES
4343
*
@@ -3360,6 +3360,15 @@ SubPostmasterMain(int argc, char *argv[])
33603360
secure_initialize();
33613361
#endif
33623362

3363+
/*
3364+
* process any libraries that should be preloaded at postmaster start
3365+
*
3366+
* NOTE: we have to re-load the shared_preload_libraries here because
3367+
* this backend is not fork()ed so we can't inherit any shared
3368+
* libraries / DLL's from our parent (the postmaster).
3369+
*/
3370+
process_shared_preload_libraries();
3371+
33633372
/*
33643373
* Perform additional initialization and client authentication.
33653374
*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy