From 5993bcaf41db623531d6f99fcf6bad85d0e97b84 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 5 Jan 2009 13:57:12 +0000 Subject: [PATCH] Quiet repeated "loaded library" messages from child backends that are just re-loading a library already loaded into the postmaster. ITAGAKI Takahiro --- src/backend/utils/init/miscinit.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index 461918ed30..b4b87b6f10 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -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); }