aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-03-20 04:51:44 +0000
committerBruce Momjian <bruce@momjian.us>2003-03-20 04:51:44 +0000
commit15ce2d2e4a3e9ae70801a5caa07579200a66b510 (patch)
tree6adec7f9487d6af68091139a0f93c260cd54c869 /src/backend/utils/misc/guc.c
parente733510d5d67a0b4fb1a9228df598034e487f194 (diff)
downloadpostgresql-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/backend/utils/misc/guc.c')
-rw-r--r--src/backend/utils/misc/guc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 37e1192b6d0..7c5d6d18849 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -5,7 +5,7 @@
* command, configuration file, and command line options.
* See src/backend/utils/misc/README for more information.
*
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.116 2003/03/04 21:51:21 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.117 2003/03/20 04:51:44 momjian Exp $
*
* Copyright 2000 by PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
@@ -60,6 +60,7 @@ extern int CheckPointTimeout;
extern bool autocommit;
extern int CommitDelay;
extern int CommitSiblings;
+extern char *preload_libraries_string;
#ifdef HAVE_SYSLOG
extern char *Syslog_facility;
@@ -815,6 +816,12 @@ static struct config_string
},
{
+ {"preload_libraries", PGC_POSTMASTER, GUC_LIST_INPUT | GUC_LIST_QUOTE},
+ &preload_libraries_string,
+ "", NULL, NULL
+ },
+
+ {
{"regex_flavor", PGC_USERSET}, &regex_flavor_string,
"advanced", assign_regex_flavor, NULL
},