Tom Lane wrote:

ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
If we set shared_preload_libraries or local_preload_libraries to
load some modules, "loaded library" messages are logged in server
log every new connections and autovacuum workers.
Yeah, I was noticing that myself while testing pg_stat_statements.
I agree that we should fix it to reduce the message level for reloads
occurring in child processes. I'd suggest using DEBUG2 if
(IsUnderPostmaster && process_shared_preload_libraries_in_progress).
I'm not so enthused about eliminating messaging for
local_preload_libraries, though.
Here is a patch to do it.

Index: src/backend/utils/init/miscinit.c
===================================================================
--- src/backend/utils/init/miscinit.c (HEAD)
+++ src/backend/utils/init/miscinit.c (fixed)
@@ -1146,6 +1146,7 @@
char *rawstring;
List *elemlist;
ListCell *l;
+ int elevel;

if (libraries == NULL || libraries[0] == '\0')
return; /* nothing to do */
@@ -1166,6 +1167,11 @@
return;
}

+ if (IsUnderPostmaster && process_shared_preload_libraries_in_progress)
+ elevel = DEBUG2;
+ else
+ elevel = LOG;
+
foreach(l, elemlist)
{
char *tok = (char *) lfirst(l);
@@ -1185,7 +1191,7 @@
filename = expanded;
}
load_file(filename, restricted);
- ereport(LOG,
+ ereport(elevel,
(errmsg("loaded library \"%s\"", filename)));
pfree(filename);
}

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 4 | next ›
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedJan 5, '09 at 2:06a
activeJan 5, '09 at 2:55p
posts4
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

ITAGAKI Takahiro: 2 posts Tom Lane: 2 posts

People

Translate

site design / logo © 2022 Grokbase