diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-03-02 21:39:36 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-03-02 21:39:36 +0000 |
commit | a033daf5663944872080f1f52deb2ffcb40f4042 (patch) | |
tree | 660da56fcf1f2d1f9e8ea31610f741bed3a8d778 /src/backend/commands | |
parent | 8d8aa931ef5a3489764de222b1bfe43463d58a13 (diff) | |
download | postgresql-a033daf5663944872080f1f52deb2ffcb40f4042.tar.gz postgresql-a033daf5663944872080f1f52deb2ffcb40f4042.zip |
Commit to match discussed elog() changes. Only update is that LOG is
now just below FATAL in server_min_messages. Added more text to
highlight ordering difference between it and client_min_messages.
---------------------------------------------------------------------------
REALLYFATAL => PANIC
STOP => PANIC
New INFO level the prints to client by default
New LOG level the prints to server log by default
Cause VACUUM information to print only to the client
NOTICE => INFO where purely information messages are sent
DEBUG => LOG for purely server status messages
DEBUG removed, kept as backward compatible
DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added
DebugLvl removed in favor of new DEBUG[1-5] symbols
New server_min_messages GUC parameter with values:
DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC
New client_min_messages GUC parameter with values:
DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC
Server startup now logged with LOG instead of DEBUG
Remove debug_level GUC parameter
elog() numbers now start at 10
Add test to print error message if older elog() values are passed to elog()
Bootstrap mode now has a -d that requires an argument, like postmaster
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/analyze.c | 13 | ||||
-rw-r--r-- | src/backend/commands/async.c | 34 | ||||
-rw-r--r-- | src/backend/commands/command.c | 5 | ||||
-rw-r--r-- | src/backend/commands/creatinh.c | 6 | ||||
-rw-r--r-- | src/backend/commands/define.c | 6 | ||||
-rw-r--r-- | src/backend/commands/explain.c | 14 | ||||
-rw-r--r-- | src/backend/commands/sequence.c | 8 | ||||
-rw-r--r-- | src/backend/commands/trigger.c | 6 | ||||
-rw-r--r-- | src/backend/commands/user.c | 6 | ||||
-rw-r--r-- | src/backend/commands/vacuum.c | 26 | ||||
-rw-r--r-- | src/backend/commands/vacuumlazy.c | 27 | ||||
-rw-r--r-- | src/backend/commands/variable.c | 24 |
12 files changed, 85 insertions, 90 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 0dc75cb4d4b..e26d66229a9 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.26 2002/02/18 16:04:14 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.27 2002/03/02 21:39:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -105,8 +105,7 @@ typedef struct #define swapInt(a,b) do {int _tmp; _tmp=a; a=b; b=_tmp;} while(0) #define swapDatum(a,b) do {Datum _tmp; _tmp=a; a=b; b=_tmp;} while(0) - -static int MESSAGE_LEVEL; +static int elevel = -1; /* context information for compare_scalars() */ static FmgrInfo *datumCmpFn; @@ -151,10 +150,10 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt) HeapTuple tuple; if (vacstmt->verbose) - MESSAGE_LEVEL = NOTICE; + elevel = INFO; else - MESSAGE_LEVEL = DEBUG; - + elevel = DEBUG1; + /* * Begin a transaction for analyzing this relation. * @@ -214,7 +213,7 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt) return; } - elog(MESSAGE_LEVEL, "Analyzing %s", RelationGetRelationName(onerel)); + elog(elevel, "Analyzing %s", RelationGetRelationName(onerel)); /* * Determine which columns to analyze diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index 3195f5fc0b8..6a0d80af2fa 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.81 2001/10/25 05:49:23 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.82 2002/03/02 21:39:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -150,7 +150,7 @@ void Async_Notify(char *relname) { if (Trace_notify) - elog(DEBUG, "Async_Notify: %s", relname); + elog(LOG, "Async_Notify: %s", relname); /* no point in making duplicate entries in the list ... */ if (!AsyncExistsPendingNotify(relname)) @@ -198,7 +198,7 @@ Async_Listen(char *relname, int pid) bool alreadyListener = false; if (Trace_notify) - elog(DEBUG, "Async_Listen: %s", relname); + elog(LOG, "Async_Listen: %s", relname); lRel = heap_openr(ListenerRelationName, AccessExclusiveLock); @@ -300,7 +300,7 @@ Async_Unlisten(char *relname, int pid) } if (Trace_notify) - elog(DEBUG, "Async_Unlisten %s", relname); + elog(LOG, "Async_Unlisten %s", relname); lRel = heap_openr(ListenerRelationName, AccessExclusiveLock); @@ -358,7 +358,7 @@ Async_UnlistenAll(void) ScanKeyData key[1]; if (Trace_notify) - elog(DEBUG, "Async_UnlistenAll"); + elog(LOG, "Async_UnlistenAll"); lRel = heap_openr(ListenerRelationName, AccessExclusiveLock); tdesc = RelationGetDescr(lRel); @@ -460,7 +460,7 @@ AtCommit_Notify(void) } if (Trace_notify) - elog(DEBUG, "AtCommit_Notify"); + elog(LOG, "AtCommit_Notify"); /* preset data to update notify column to MyProcPid */ nulls[0] = nulls[1] = nulls[2] = ' '; @@ -492,14 +492,14 @@ AtCommit_Notify(void) */ if (Trace_notify) - elog(DEBUG, "AtCommit_Notify: notifying self"); + elog(LOG, "AtCommit_Notify: notifying self"); NotifyMyFrontEnd(relname, listenerPID); } else { if (Trace_notify) - elog(DEBUG, "AtCommit_Notify: notifying pid %d", + elog(LOG, "AtCommit_Notify: notifying pid %d", listenerPID); /* @@ -555,7 +555,7 @@ AtCommit_Notify(void) ClearPendingNotifies(); if (Trace_notify) - elog(DEBUG, "AtCommit_Notify: done"); + elog(LOG, "AtCommit_Notify: done"); } /* @@ -628,12 +628,12 @@ Async_NotifyHandler(SIGNAL_ARGS) { /* Here, it is finally safe to do stuff. */ if (Trace_notify) - elog(DEBUG, "Async_NotifyHandler: perform async notify"); + elog(LOG, "Async_NotifyHandler: perform async notify"); ProcessIncomingNotify(); if (Trace_notify) - elog(DEBUG, "Async_NotifyHandler: done"); + elog(LOG, "Async_NotifyHandler: done"); } } } @@ -700,12 +700,12 @@ EnableNotifyInterrupt(void) if (notifyInterruptOccurred) { if (Trace_notify) - elog(DEBUG, "EnableNotifyInterrupt: perform async notify"); + elog(LOG, "EnableNotifyInterrupt: perform async notify"); ProcessIncomingNotify(); if (Trace_notify) - elog(DEBUG, "EnableNotifyInterrupt: done"); + elog(LOG, "EnableNotifyInterrupt: done"); } } } @@ -756,7 +756,7 @@ ProcessIncomingNotify(void) nulls[Natts_pg_listener]; if (Trace_notify) - elog(DEBUG, "ProcessIncomingNotify"); + elog(LOG, "ProcessIncomingNotify"); set_ps_display("async_notify"); @@ -792,7 +792,7 @@ ProcessIncomingNotify(void) /* Notify the frontend */ if (Trace_notify) - elog(DEBUG, "ProcessIncomingNotify: received %s from %d", + elog(LOG, "ProcessIncomingNotify: received %s from %d", relname, (int) sourcePID); NotifyMyFrontEnd(relname, sourcePID); @@ -834,7 +834,7 @@ ProcessIncomingNotify(void) set_ps_display("idle"); if (Trace_notify) - elog(DEBUG, "ProcessIncomingNotify: done"); + elog(LOG, "ProcessIncomingNotify: done"); } /* @@ -861,7 +861,7 @@ NotifyMyFrontEnd(char *relname, int32 listenerPID) */ } else - elog(NOTICE, "NOTIFY for %s", relname); + elog(INFO, "NOTIFY for %s", relname); } /* Does pendingNotifies include the given relname? */ diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c index 64554aa2da6..eefbe269f30 100644 --- a/src/backend/commands/command.c +++ b/src/backend/commands/command.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.156 2002/02/27 19:34:38 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.157 2002/03/02 21:39:22 momjian Exp $ * * NOTES * The PerformAddAttribute() code, like most of the relation @@ -1501,8 +1501,7 @@ AlterTableDropConstraint(const char *relationName, constrName); /* Otherwise if more than one constraint deleted, notify */ else if (deleted > 1) - elog(NOTICE, "Multiple constraints dropped"); - + elog(INFO, "Multiple constraints dropped"); } diff --git a/src/backend/commands/creatinh.c b/src/backend/commands/creatinh.c index 0c1e7268d7f..468434ea2a5 100644 --- a/src/backend/commands/creatinh.c +++ b/src/backend/commands/creatinh.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.81 2001/10/25 05:49:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.82 2002/03/02 21:39:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -425,7 +425,7 @@ MergeAttributes(List *schema, List *supers, bool istemp, * Yes, try to merge the two column definitions. They must * have the same type and typmod. */ - elog(NOTICE, "CREATE TABLE: merging multiple inherited definitions of attribute \"%s\"", + elog(INFO, "CREATE TABLE: merging multiple inherited definitions of attribute \"%s\"", attributeName); def = (ColumnDef *) nth(exist_attno - 1, inhSchema); if (strcmp(def->typename->name, attributeType) != 0 || @@ -564,7 +564,7 @@ MergeAttributes(List *schema, List *supers, bool istemp, * Yes, try to merge the two column definitions. They must * have the same type and typmod. */ - elog(NOTICE, "CREATE TABLE: merging attribute \"%s\" with inherited definition", + elog(INFO, "CREATE TABLE: merging attribute \"%s\" with inherited definition", attributeName); def = (ColumnDef *) nth(exist_attno - 1, inhSchema); if (strcmp(def->typename->name, attributeType) != 0 || diff --git a/src/backend/commands/define.c b/src/backend/commands/define.c index 140690a5a4b..810c9bf1b43 100644 --- a/src/backend/commands/define.c +++ b/src/backend/commands/define.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.65 2002/02/18 23:11:10 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.66 2002/03/02 21:39:23 momjian Exp $ * * DESCRIPTION * The "DefineFoo" routines take the parse tree and pick out the @@ -348,12 +348,12 @@ DefineOperator(char *oprName, else if (strcasecmp(defel->defname, "precedence") == 0) { /* NOT IMPLEMENTED (never worked in v4.2) */ - elog(NOTICE, "CREATE OPERATOR: precedence not implemented"); + elog(INFO, "CREATE OPERATOR: precedence not implemented"); } else if (strcasecmp(defel->defname, "associativity") == 0) { /* NOT IMPLEMENTED (never worked in v4.2) */ - elog(NOTICE, "CREATE OPERATOR: associativity not implemented"); + elog(INFO, "CREATE OPERATOR: associativity not implemented"); } else if (strcasecmp(defel->defname, "commutator") == 0) commutatorName = defGetString(defel); diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 9c966873147..faea169a636 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994-5, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.68 2002/02/26 22:47:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.69 2002/03/02 21:39:23 momjian Exp $ * */ @@ -59,7 +59,7 @@ ExplainQuery(Query *query, bool verbose, bool analyze, CommandDest dest) /* rewriter will not cope with utility statements */ if (query->commandType == CMD_UTILITY) { - elog(NOTICE, "Utility statements have no plan structure"); + elog(INFO, "Utility statements have no plan structure"); return; } @@ -69,7 +69,7 @@ ExplainQuery(Query *query, bool verbose, bool analyze, CommandDest dest) /* In the case of an INSTEAD NOTHING, tell at least that */ if (rewritten == NIL) { - elog(NOTICE, "Query rewrites to nothing"); + elog(INFO, "Query rewrites to nothing"); return; } @@ -94,9 +94,9 @@ ExplainOneQuery(Query *query, bool verbose, bool analyze, CommandDest dest) if (query->commandType == CMD_UTILITY) { if (query->utilityStmt && IsA(query->utilityStmt, NotifyStmt)) - elog(NOTICE, "QUERY PLAN:\n\nNOTIFY\n"); + elog(INFO, "QUERY PLAN:\n\nNOTIFY\n"); else - elog(NOTICE, "QUERY PLAN:\n\nUTILITY\n"); + elog(INFO, "QUERY PLAN:\n\nUTILITY\n"); return; } @@ -152,7 +152,7 @@ ExplainOneQuery(Query *query, bool verbose, bool analyze, CommandDest dest) s = nodeToString(plan); if (s) { - elog(NOTICE, "QUERY DUMP:\n\n%s", s); + elog(INFO, "QUERY DUMP:\n\n%s", s); pfree(s); } } @@ -165,7 +165,7 @@ ExplainOneQuery(Query *query, bool verbose, bool analyze, CommandDest dest) if (analyze) appendStringInfo(str, "Total runtime: %.2f msec\n", 1000.0 * totaltime); - elog(NOTICE, "QUERY PLAN:\n\n%s", str->data); + elog(INFO, "QUERY PLAN:\n\n%s", str->data); pfree(str->data); pfree(str); } diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index d5d53e696a0..1552252626f 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.68 2002/01/11 18:16:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.69 2002/03/02 21:39:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -879,7 +879,7 @@ seq_redo(XLogRecPtr lsn, XLogRecord *record) sequence_magic *sm; if (info != XLOG_SEQ_LOG) - elog(STOP, "seq_redo: unknown op code %u", info); + elog(PANIC, "seq_redo: unknown op code %u", info); reln = XLogOpenRelation(true, RM_SEQ_ID, xlrec->node); if (!RelationIsValid(reln)) @@ -887,7 +887,7 @@ seq_redo(XLogRecPtr lsn, XLogRecord *record) buffer = XLogReadBuffer(true, reln, 0); if (!BufferIsValid(buffer)) - elog(STOP, "seq_redo: can't read block of %u/%u", + elog(PANIC, "seq_redo: can't read block of %u/%u", xlrec->node.tblNode, xlrec->node.relNode); page = (Page) BufferGetPage(buffer); @@ -903,7 +903,7 @@ seq_redo(XLogRecPtr lsn, XLogRecord *record) itemsz = MAXALIGN(itemsz); if (PageAddItem(page, (Item) item, itemsz, FirstOffsetNumber, LP_USED) == InvalidOffsetNumber) - elog(STOP, "seq_redo: failed to add item to page"); + elog(PANIC, "seq_redo: failed to add item to page"); PageSetLSN(page, lsn); PageSetSUI(page, ThisStartUpID); diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 402ff51e4bc..d424c5eb05d 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.102 2002/02/19 20:11:12 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.103 2002/03/02 21:39:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -368,7 +368,7 @@ DropTrigger(DropTrigStmt *stmt) elog(ERROR, "DropTrigger: there is no trigger %s on relation %s", stmt->trigname, stmt->relname); if (tgfound > 1) - elog(NOTICE, "DropTrigger: found (and deleted) %d triggers %s on relation %s", + elog(INFO, "DropTrigger: found (and deleted) %d triggers %s on relation %s", tgfound, stmt->trigname, stmt->relname); /* @@ -489,7 +489,7 @@ RelationRemoveTriggers(Relation rel) stmt.relname = pstrdup(RelationGetRelationName(refrel)); heap_close(refrel, NoLock); - elog(NOTICE, "DROP TABLE implicitly drops referential integrity trigger from table \"%s\"", stmt.relname); + elog(INFO, "DROP TABLE implicitly drops referential integrity trigger from table \"%s\"", stmt.relname); DropTrigger(&stmt); diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index a059207b0aa..45351b7ad0e 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.91 2002/03/01 22:45:08 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.92 2002/03/02 21:39:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -547,7 +547,7 @@ AlterUser(AlterUserStmt *stmt) /* changes to the flat password file cannot be rolled back */ if (IsTransactionBlock() && password) - elog(NOTICE, "ALTER USER: password changes cannot be rolled back"); + elog(INFO, "ALTER USER: password changes cannot be rolled back"); /* * Scan the pg_shadow relation to be certain the user exists. Note we @@ -785,7 +785,7 @@ DropUser(DropUserStmt *stmt) elog(ERROR, "DROP USER: permission denied"); if (IsTransactionBlock()) - elog(NOTICE, "DROP USER cannot be rolled back completely"); + elog(INFO, "DROP USER cannot be rolled back completely"); /* * Scan the pg_shadow relation to find the usesysid of the user to be diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index a36ae25b3f8..a88ce7099ec 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -13,7 +13,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.214 2002/02/19 20:11:12 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.215 2002/03/02 21:39:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -108,7 +108,7 @@ typedef struct VRelStats static MemoryContext vac_context = NULL; -static int MESSAGE_LEVEL; /* message level */ +static int elevel = -1; static TransactionId OldestXmin; static TransactionId FreezeLimit; @@ -192,10 +192,10 @@ vacuum(VacuumStmt *vacstmt) pgstat_vacuum_tabstat(); if (vacstmt->verbose) - MESSAGE_LEVEL = NOTICE; + elevel = INFO; else - MESSAGE_LEVEL = DEBUG; - + elevel = DEBUG1; + /* * Create special memory context for cross-transaction storage. * @@ -964,7 +964,7 @@ scan_heap(VRelStats *vacrelstats, Relation onerel, vac_init_rusage(&ru0); relname = RelationGetRelationName(onerel); - elog(MESSAGE_LEVEL, "--Relation %s--", relname); + elog(elevel, "--Relation %s--", relname); empty_pages = new_pages = changed_pages = empty_end_pages = 0; num_tuples = tups_vacuumed = nkeep = nunused = 0; @@ -1275,7 +1275,7 @@ scan_heap(VRelStats *vacrelstats, Relation onerel, pfree(vtlinks); } - elog(MESSAGE_LEVEL, "Pages %u: Changed %u, reaped %u, Empty %u, New %u; \ + elog(elevel, "Pages %u: Changed %u, reaped %u, Empty %u, New %u; \ Tup %.0f: Vac %.0f, Keep/VTL %.0f/%u, UnUsed %.0f, MinLen %lu, MaxLen %lu; \ Re-using: Free/Avail. Space %.0f/%.0f; EndEmpty/Avail. Pages %u/%u.\n\t%s", nblocks, changed_pages, vacuum_pages->num_pages, empty_pages, @@ -1849,7 +1849,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, InvalidOffsetNumber, LP_USED); if (newoff == InvalidOffsetNumber) { - elog(STOP, "moving chain: failed to add item with len = %lu to page %u", + elog(PANIC, "moving chain: failed to add item with len = %lu to page %u", (unsigned long) tuple_len, destvacpage->blkno); } newitemid = PageGetItemId(ToPage, newoff); @@ -1972,7 +1972,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, InvalidOffsetNumber, LP_USED); if (newoff == InvalidOffsetNumber) { - elog(STOP, "failed to add item with len = %lu to page %u (free space %lu, nusd %u, noff %u)", + elog(PANIC, "failed to add item with len = %lu to page %u (free space %lu, nusd %u, noff %u)", (unsigned long) tuple_len, cur_page->blkno, (unsigned long) cur_page->free, cur_page->offsets_used, cur_page->offsets_free); @@ -2197,7 +2197,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, } Assert(num_moved == checked_moved); - elog(MESSAGE_LEVEL, "Rel %s: Pages: %u --> %u; Tuple(s) moved: %u.\n\t%s", + elog(elevel, "Rel %s: Pages: %u --> %u; Tuple(s) moved: %u.\n\t%s", RelationGetRelationName(onerel), nblocks, blkno, num_moved, vac_show_rusage(&ru0)); @@ -2369,7 +2369,7 @@ vacuum_heap(VRelStats *vacrelstats, Relation onerel, VacPageList vacuum_pages) /* truncate relation if there are some empty end-pages */ if (vacuum_pages->empty_end_pages > 0) { - elog(MESSAGE_LEVEL, "Rel %s: Pages: %u --> %u.", + elog(elevel, "Rel %s: Pages: %u --> %u.", RelationGetRelationName(onerel), vacrelstats->rel_pages, relblocks); relblocks = smgrtruncate(DEFAULT_SMGR, onerel, relblocks); @@ -2443,7 +2443,7 @@ scan_index(Relation indrel, double num_tuples) stats->num_pages, stats->num_index_tuples, false); - elog(MESSAGE_LEVEL, "Index %s: Pages %u; Tuples %.0f.\n\t%s", + elog(elevel, "Index %s: Pages %u; Tuples %.0f.\n\t%s", RelationGetRelationName(indrel), stats->num_pages, stats->num_index_tuples, vac_show_rusage(&ru0)); @@ -2497,7 +2497,7 @@ vacuum_index(VacPageList vacpagelist, Relation indrel, stats->num_pages, stats->num_index_tuples, false); - elog(MESSAGE_LEVEL, "Index %s: Pages %u; Tuples %.0f: Deleted %.0f.\n\t%s", + elog(elevel, "Index %s: Pages %u; Tuples %.0f: Deleted %.0f.\n\t%s", RelationGetRelationName(indrel), stats->num_pages, stats->num_index_tuples - keep_tuples, stats->tuples_removed, vac_show_rusage(&ru0)); diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c index 088ad9c8aed..39a9679922f 100644 --- a/src/backend/commands/vacuumlazy.c +++ b/src/backend/commands/vacuumlazy.c @@ -31,7 +31,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/vacuumlazy.c,v 1.11 2002/01/06 00:37:44 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/vacuumlazy.c,v 1.12 2002/03/02 21:39:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -92,7 +92,7 @@ typedef struct LVRelStats } LVRelStats; -static int MESSAGE_LEVEL; /* message level */ +static int elevel = -1; static TransactionId OldestXmin; static TransactionId FreezeLimit; @@ -138,12 +138,11 @@ lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt) bool hasindex; BlockNumber possibly_freeable; - /* initialize */ if (vacstmt->verbose) - MESSAGE_LEVEL = NOTICE; + elevel = INFO; else - MESSAGE_LEVEL = DEBUG; - + elevel = DEBUG1; + vacuum_set_xid_limits(vacstmt, onerel->rd_rel->relisshared, &OldestXmin, &FreezeLimit); @@ -208,7 +207,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats, vac_init_rusage(&ru0); relname = RelationGetRelationName(onerel); - elog(MESSAGE_LEVEL, "--Relation %s--", relname); + elog(elevel, "--Relation %s--", relname); empty_pages = changed_pages = 0; num_tuples = tups_vacuumed = nkeep = nunused = 0; @@ -430,7 +429,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats, lazy_scan_index(Irel[i], vacrelstats); } - elog(MESSAGE_LEVEL, "Pages %u: Changed %u, Empty %u; \ + elog(elevel, "Pages %u: Changed %u, Empty %u; \ Tup %.0f: Vac %.0f, Keep %.0f, UnUsed %.0f.\n\tTotal %s", nblocks, changed_pages, empty_pages, num_tuples, tups_vacuumed, nkeep, nunused, @@ -481,8 +480,7 @@ lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats) npages++; } - elog(MESSAGE_LEVEL, "Removed %d tuples in %d pages.\n\t%s", - tupindex, npages, + elog(elevel, "Removed %d tuples in %d pages.\n\t%s", tupindex, npages, vac_show_rusage(&ru0)); } @@ -589,7 +587,7 @@ lazy_scan_index(Relation indrel, LVRelStats *vacrelstats) stats->num_pages, stats->num_index_tuples, false); - elog(MESSAGE_LEVEL, "Index %s: Pages %u; Tuples %.0f.\n\t%s", + elog(elevel, "Index %s: Pages %u; Tuples %.0f.\n\t%s", RelationGetRelationName(indrel), stats->num_pages, stats->num_index_tuples, vac_show_rusage(&ru0)); @@ -636,7 +634,7 @@ lazy_vacuum_index(Relation indrel, LVRelStats *vacrelstats) stats->num_pages, stats->num_index_tuples, false); - elog(MESSAGE_LEVEL, "Index %s: Pages %u; Tuples %.0f: Deleted %.0f.\n\t%s", + elog(elevel, "Index %s: Pages %u; Tuples %.0f: Deleted %.0f.\n\t%s", RelationGetRelationName(indrel), stats->num_pages, stats->num_index_tuples, stats->tuples_removed, vac_show_rusage(&ru0)); @@ -746,9 +744,8 @@ lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats) * We keep the exclusive lock until commit (perhaps not necessary)? */ - elog(MESSAGE_LEVEL, "Truncated %u --> %u pages.\n\t%s", - old_rel_pages, new_rel_pages, - vac_show_rusage(&ru0)); + elog(elevel, "Truncated %u --> %u pages.\n\t%s", old_rel_pages, + new_rel_pages, vac_show_rusage(&ru0)); } /* diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index 1723733799a..594b8643067 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.58 2002/02/23 01:31:35 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.59 2002/03/02 21:39:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -295,7 +295,7 @@ show_datestyle(void) strcat(buf, ((EuroDates) ? "European" : "US (NonEuropean)")); strcat(buf, " conventions"); - elog(NOTICE, buf, NULL); + elog(INFO, buf, NULL); return TRUE; } @@ -482,9 +482,9 @@ show_timezone(void) tzn = getenv("TZ"); if (tzn != NULL) - elog(NOTICE, "Time zone is '%s'", tzn); + elog(INFO, "Time zone is '%s'", tzn); else - elog(NOTICE, "Time zone is unset"); + elog(INFO, "Time zone is unset"); return TRUE; } /* show_timezone() */ @@ -576,9 +576,9 @@ show_XactIsoLevel(void) { if (XactIsoLevel == XACT_SERIALIZABLE) - elog(NOTICE, "TRANSACTION ISOLATION LEVEL is SERIALIZABLE"); + elog(INFO, "TRANSACTION ISOLATION LEVEL is SERIALIZABLE"); else - elog(NOTICE, "TRANSACTION ISOLATION LEVEL is READ COMMITTED"); + elog(INFO, "TRANSACTION ISOLATION LEVEL is READ COMMITTED"); return TRUE; } @@ -623,7 +623,7 @@ parse_random_seed(List *args) static bool show_random_seed(void) { - elog(NOTICE, "Seed for random number generator is unavailable"); + elog(INFO, "Seed for random number generator is unavailable"); return (TRUE); } @@ -690,7 +690,7 @@ parse_client_encoding(List *args) static bool show_client_encoding(void) { - elog(NOTICE, "Current client encoding is '%s'", + elog(INFO, "Current client encoding is '%s'", pg_get_client_encoding_name()); return TRUE; } @@ -727,21 +727,21 @@ set_default_client_encoding(void) static bool parse_server_encoding(List *args) { - elog(NOTICE, "SET SERVER_ENCODING is not supported"); + elog(INFO, "SET SERVER_ENCODING is not supported"); return TRUE; } static bool show_server_encoding(void) { - elog(NOTICE, "Current server encoding is '%s'", GetDatabaseEncodingName()); + elog(INFO, "Current server encoding is '%s'", GetDatabaseEncodingName()); return TRUE; } static bool reset_server_encoding(void) { - elog(NOTICE, "RESET SERVER_ENCODING is not supported"); + elog(INFO, "RESET SERVER_ENCODING is not supported"); return TRUE; } @@ -814,7 +814,7 @@ GetPGVariable(const char *name) { const char *val = GetConfigOption(name); - elog(NOTICE, "%s is %s", name, val); + elog(INFO, "%s is %s", name, val); } } |