diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-03-20 04:51:44 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-03-20 04:51:44 +0000 |
commit | 15ce2d2e4a3e9ae70801a5caa07579200a66b510 (patch) | |
tree | 6adec7f9487d6af68091139a0f93c260cd54c869 /src/include/miscadmin.h | |
parent | e733510d5d67a0b4fb1a9228df598034e487f194 (diff) | |
download | postgresql-15ce2d2e4a3e9ae70801a5caa07579200a66b510.tar.gz postgresql-15ce2d2e4a3e9ae70801a5caa07579200a66b510.zip |
> I can see a couple possible downsides: (a) the library might have some
> weird behavior across fork boundaries; (b) the additional memory space
> that has to be duplicated into child processes will cost something per
> child launch, even if the child never uses it. But these are only
> arguments that it might not *always* be a prudent thing to do, not that
> we shouldn't give the DBA the tool to do it if he wants. So fire away.
Here is a patch for the above, including a documentation update. It
creates a new GUC variable "preload_libraries", that accepts a list in
the form:
preload_libraries = '$libdir/mylib1:initfunc,$libdir/mylib2'
If ":initfunc" is omitted or not found, no initialization function is
executed, but the library is still preloaded. If "$libdir/mylib" isn't
found, the postmaster refuses to start.
In my testing with PL/R, it reduces the first call to a PL/R function
(after connecting) from almost 2 seconds, down to about 8 ms.
Joe Conway
Diffstat (limited to 'src/include/miscadmin.h')
-rw-r--r-- | src/include/miscadmin.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index f8321325f6c..e44d0fbad30 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: miscadmin.h,v 1.116 2003/02/22 05:57:45 tgl Exp $ + * $Id: miscadmin.h,v 1.117 2003/03/20 04:51:44 momjian Exp $ * * NOTES * some of the information in this file should be moved to @@ -288,6 +288,7 @@ extern void RecordSharedMemoryInLockFile(unsigned long id1, unsigned long id2); extern void ValidatePgVersion(const char *path); +extern void process_preload_libraries(char *preload_libraries_string); /* these externs do not belong here... */ extern void IgnoreSystemIndexes(bool mode); |