Skip to content

Commit 2c4dea1

Browse files
committed
Issue free space notices to both the user and the server log file.
1 parent 28bcc34 commit 2c4dea1

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/backend/storage/freespace/freespace.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/freespace/freespace.c,v 1.38 2005/03/12 05:21:52 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/freespace/freespace.c,v 1.39 2005/03/14 20:15:09 momjian Exp $
1212
*
1313
*
1414
* NOTES:
@@ -221,6 +221,8 @@ static HTAB *FreeSpaceMapRelHash; /* points to (what used to be)
221221
* FSMHeader->relHash */
222222

223223

224+
static void CheckFreeSpaceMapStatistics(int elevel, int numRels,
225+
double needed);
224226
static FSMRelation *lookup_fsm_rel(RelFileNode *rel);
225227
static FSMRelation *create_fsm_rel(RelFileNode *rel);
226228
static void delete_fsm_rel(FSMRelation *fsmrel);
@@ -711,16 +713,24 @@ PrintFreeSpaceMapStatistics(int elevel)
711713
errdetail("FSM size: %d relations + %d pages = %.0f kB shared memory.",
712714
MaxFSMRelations, MaxFSMPages,
713715
(double) FreeSpaceShmemSize() / 1024.0)));
714-
715-
if (numRels == MaxFSMRelations)
716-
ereport(NOTICE,
716+
717+
CheckFreeSpaceMapStatistics(NOTICE, numRels, needed);
718+
/* Print to server logs too because is deals with a config variable. */
719+
CheckFreeSpaceMapStatistics(LOG, numRels, needed);
720+
}
721+
722+
static void
723+
CheckFreeSpaceMapStatistics(int elevel, int numRels, double needed)
724+
{
725+
if (numRels == MaxFSMRelations)
726+
ereport(elevel,
717727
(errmsg("max_fsm_relations(%d) equals the number of relations checked",
718728
MaxFSMRelations),
719729
errhint("You have >= %d relations.\n"
720730
"Consider increasing the configuration parameter \"max_fsm_relations\".",
721731
numRels)));
722732
else if (needed > MaxFSMPages)
723-
ereport(NOTICE,
733+
ereport(elevel,
724734
(errmsg("the number of page slots needed (%.0f) exceeds max_fsm_pages (%d)",
725735
needed,MaxFSMPages),
726736
errhint("Consider increasing the configuration parameter \"max_fsm_relations\"\n"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy