Commit 5993bcaf authored by Tom Lane's avatar Tom Lane

Quiet repeated "loaded library" messages from child backends that are just

re-loading a library already loaded into the postmaster.

ITAGAKI Takahiro
parent da2c1b8a
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.171 2009/01/03 20:03:08 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.172 2009/01/05 13:57:12 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1145,6 +1145,7 @@ load_libraries(const char *libraries, const char *gucname, bool restricted) ...@@ -1145,6 +1145,7 @@ load_libraries(const char *libraries, const char *gucname, bool restricted)
{ {
char *rawstring; char *rawstring;
List *elemlist; List *elemlist;
int elevel;
ListCell *l; ListCell *l;
if (libraries == NULL || libraries[0] == '\0') if (libraries == NULL || libraries[0] == '\0')
...@@ -1166,6 +1167,18 @@ load_libraries(const char *libraries, const char *gucname, bool restricted) ...@@ -1166,6 +1167,18 @@ load_libraries(const char *libraries, const char *gucname, bool restricted)
return; return;
} }
/*
* Choose notice level: avoid repeat messages when re-loading a library
* that was preloaded into the postmaster. (Only possible in EXEC_BACKEND
* configurations)
*/
#ifdef EXEC_BACKEND
if (IsUnderPostmaster && process_shared_preload_libraries_in_progress)
elevel = DEBUG2;
else
#endif
elevel = LOG;
foreach(l, elemlist) foreach(l, elemlist)
{ {
char *tok = (char *) lfirst(l); char *tok = (char *) lfirst(l);
...@@ -1185,7 +1198,7 @@ load_libraries(const char *libraries, const char *gucname, bool restricted) ...@@ -1185,7 +1198,7 @@ load_libraries(const char *libraries, const char *gucname, bool restricted)
filename = expanded; filename = expanded;
} }
load_file(filename, restricted); load_file(filename, restricted);
ereport(LOG, ereport(elevel,
(errmsg("loaded library \"%s\"", filename))); (errmsg("loaded library \"%s\"", filename)));
pfree(filename); pfree(filename);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment