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

re-loading a library already loaded into the postmaster.

ITAGAKI Takahiro
This commit is contained in:
Tom Lane 2009-01-05 13:57:12 +00:00
parent da2c1b8a27
commit 5993bcaf41

View File

@ -8,7 +8,7 @@
*
*
* 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)
{
char *rawstring;
List *elemlist;
int elevel;
ListCell *l;
if (libraries == NULL || libraries[0] == '\0')
@ -1166,6 +1167,18 @@ load_libraries(const char *libraries, const char *gucname, bool restricted)
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)
{
char *tok = (char *) lfirst(l);
@ -1185,7 +1198,7 @@ load_libraries(const char *libraries, const char *gucname, bool restricted)
filename = expanded;
}
load_file(filename, restricted);
ereport(LOG,
ereport(elevel,
(errmsg("loaded library \"%s\"", filename)));
pfree(filename);
}