Commit a033daf5 authored by Bruce Momjian's avatar Bruce Momjian

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
parent 8d8aa931
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.23 2001/12/08 03:24:38 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.24 2002/03/02 21:39:16 momjian Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -141,8 +141,10 @@ PostgreSQL documentation ...@@ -141,8 +141,10 @@ PostgreSQL documentation
<para> <para>
The options <option>-A</option>, <option>-B</option>, The options <option>-A</option>, <option>-B</option>,
<option>-c</option>, <option>-d</option>, <option>-D</option>, <option>-c</option>, <option>-d</option>, <option>-D</option>,
<option>-F</option>, and <option>--name</> have the same meanings as <option>-F</option>, and <option>--name</> have the same meanings
for the <xref linkend="app-postmaster">. as the <xref linkend="app-postmaster"> except that
<option>-d</option> <literal>0</> prevents the debugging level of
the postmaster from being propogated to the backend.
</para> </para>
<variablelist> <variablelist>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/postmaster.sgml,v 1.26 2001/12/08 03:24:38 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/postmaster.sgml,v 1.27 2002/03/02 21:39:16 momjian Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -127,9 +127,8 @@ PostgreSQL documentation ...@@ -127,9 +127,8 @@ PostgreSQL documentation
<listitem> <listitem>
<para> <para>
Sets the debug level. The higher this value is set, the more Sets the debug level. The higher this value is set, the more
debugging output is written to the server log. The default is debugging output is written to the server log. Values are from
0, which means no debugging. Values up to 4 are useful; higher 1 to 5.
numbers produce no additional output.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.104 2002/03/01 22:45:05 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.105 2002/03/02 21:39:15 momjian Exp $
--> -->
<Chapter Id="runtime"> <Chapter Id="runtime">
...@@ -813,6 +813,38 @@ env PGOPTIONS='-c geqo=off' psql ...@@ -813,6 +813,38 @@ env PGOPTIONS='-c geqo=off' psql
<para> <para>
<variablelist> <variablelist>
<varlistentry>
<term><varname>SERVER_MIN_MESSAGES</varname> (<type>string</type>)</term>
<listitem>
<para>
This controls how much detail is written to the server logs. The
default is <literal>NOTICE</>. Valid values are <literal>DEBUG5</>,
<literal>DEBUG4</>, <literal>DEBUG3</>, <literal>DEBUG2</>,
<literal>DEBUG1</>, <literal>INFO</>, <literal>NOTICE</>,
<literal>ERROR</>, <literal>LOG</>, <literal>FATAL</>,
<literal>PANIC</>. Later values send less detail to the logs.
<literal>LOG</> has a different precedence here than in
<literal>CLIENT_MIN_MESSAGES</>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>CLIENT_MIN_MESSAGES</varname> (<type>string</type>)</term>
<listitem>
<para>
This controls how much detail is written to the client. The
default is <literal>INFO</>. Valid values are
<literal>DEBUG5</>, <literal>DEBUG4</>, <literal>DEBUG3</>,
<literal>DEBUG2</>, <literal>DEBUG1</>, <literal>LOG</>,
<literal>INFO</>, <literal>NOTICE</>, <literal>ERROR</>,
<literal>FATAL</>, <literal>PANIC</>. Later values send less
information to the user. literal>LOG</> has a different
precedence here than in <literal>SERVER_MIN_MESSAGES</>.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>DEBUG_ASSERTIONS</varname> (<type>boolean</type>)</term> <term><varname>DEBUG_ASSERTIONS</varname> (<type>boolean</type>)</term>
<listitem> <listitem>
...@@ -829,19 +861,6 @@ env PGOPTIONS='-c geqo=off' psql ...@@ -829,19 +861,6 @@ env PGOPTIONS='-c geqo=off' psql
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>DEBUG_LEVEL</varname> (<type>integer</type>)</term>
<listitem>
<para>
The higher this value is set, the more
<quote>debugging</quote> output of various sorts is generated
in the server log during operation. This option is 0 by
default, which means no debugging output. Values up to about 4
currently make sense.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>DEBUG_PRINT_QUERY</varname> (<type>boolean</type>)</term> <term><varname>DEBUG_PRINT_QUERY</varname> (<type>boolean</type>)</term>
<term><varname>DEBUG_PRINT_PARSE</varname> (<type>boolean</type>)</term> <term><varname>DEBUG_PRINT_PARSE</varname> (<type>boolean</type>)</term>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.88 2002/02/11 22:41:59 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.89 2002/03/02 21:39:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1953,13 +1953,13 @@ gist_dumptree(Relation r, int level, BlockNumber blk, OffsetNumber coff) ...@@ -1953,13 +1953,13 @@ gist_dumptree(Relation r, int level, BlockNumber blk, OffsetNumber coff)
void void
gist_redo(XLogRecPtr lsn, XLogRecord *record) gist_redo(XLogRecPtr lsn, XLogRecord *record)
{ {
elog(STOP, "gist_redo: unimplemented"); elog(PANIC, "gist_redo: unimplemented");
} }
void void
gist_undo(XLogRecPtr lsn, XLogRecord *record) gist_undo(XLogRecPtr lsn, XLogRecord *record)
{ {
elog(STOP, "gist_undo: unimplemented"); elog(PANIC, "gist_undo: unimplemented");
} }
void void
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.53 2001/10/25 05:49:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.54 2002/03/02 21:39:16 momjian Exp $
* *
* NOTES * NOTES
* This file contains only the public interface routines. * This file contains only the public interface routines.
...@@ -468,13 +468,13 @@ hashbulkdelete(PG_FUNCTION_ARGS) ...@@ -468,13 +468,13 @@ hashbulkdelete(PG_FUNCTION_ARGS)
void void
hash_redo(XLogRecPtr lsn, XLogRecord *record) hash_redo(XLogRecPtr lsn, XLogRecord *record)
{ {
elog(STOP, "hash_redo: unimplemented"); elog(PANIC, "hash_redo: unimplemented");
} }
void void
hash_undo(XLogRecPtr lsn, XLogRecord *record) hash_undo(XLogRecPtr lsn, XLogRecord *record)
{ {
elog(STOP, "hash_undo: unimplemented"); elog(PANIC, "hash_undo: unimplemented");
} }
void void
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Id: hio.c,v 1.43 2001/10/25 05:49:21 momjian Exp $ * $Id: hio.c,v 1.44 2002/03/02 21:39:18 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -50,7 +50,7 @@ RelationPutHeapTuple(Relation relation, ...@@ -50,7 +50,7 @@ RelationPutHeapTuple(Relation relation,
tuple->t_len, InvalidOffsetNumber, LP_USED); tuple->t_len, InvalidOffsetNumber, LP_USED);
if (offnum == InvalidOffsetNumber) if (offnum == InvalidOffsetNumber)
elog(STOP, "RelationPutHeapTuple: failed to add tuple"); elog(PANIC, "RelationPutHeapTuple: failed to add tuple");
/* Update tuple->t_self to the actual position where it was stored */ /* Update tuple->t_self to the actual position where it was stored */
ItemPointerSet(&(tuple->t_self), BufferGetBlockNumber(buffer), offnum); ItemPointerSet(&(tuple->t_self), BufferGetBlockNumber(buffer), offnum);
...@@ -270,7 +270,7 @@ RelationGetBufferForTuple(Relation relation, Size len, ...@@ -270,7 +270,7 @@ RelationGetBufferForTuple(Relation relation, Size len,
if (len > PageGetFreeSpace(pageHeader)) if (len > PageGetFreeSpace(pageHeader))
{ {
/* We should not get here given the test at the top */ /* We should not get here given the test at the top */
elog(STOP, "Tuple is too big: size %lu", (unsigned long) len); elog(PANIC, "Tuple is too big: size %lu", (unsigned long) len);
} }
/* /*
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.88 2002/01/01 20:32:37 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.89 2002/03/02 21:39:18 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -507,7 +507,7 @@ _bt_insertonpg(Relation rel, ...@@ -507,7 +507,7 @@ _bt_insertonpg(Relation rel,
/* If root page was splitted */ /* If root page was splitted */
if (stack == (BTStack) NULL) if (stack == (BTStack) NULL)
{ {
elog(DEBUG, "btree: concurrent ROOT page split"); elog(LOG, "btree: concurrent ROOT page split");
/* /*
* If root page splitter failed to create new root page * If root page splitter failed to create new root page
...@@ -735,7 +735,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright, ...@@ -735,7 +735,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
item = (BTItem) PageGetItem(origpage, itemid); item = (BTItem) PageGetItem(origpage, itemid);
if (PageAddItem(rightpage, (Item) item, itemsz, rightoff, if (PageAddItem(rightpage, (Item) item, itemsz, rightoff,
LP_USED) == InvalidOffsetNumber) LP_USED) == InvalidOffsetNumber)
elog(STOP, "btree: failed to add hikey to the right sibling"); elog(PANIC, "btree: failed to add hikey to the right sibling");
rightoff = OffsetNumberNext(rightoff); rightoff = OffsetNumberNext(rightoff);
} }
...@@ -761,7 +761,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright, ...@@ -761,7 +761,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
lhikey = item; lhikey = item;
if (PageAddItem(leftpage, (Item) item, itemsz, leftoff, if (PageAddItem(leftpage, (Item) item, itemsz, leftoff,
LP_USED) == InvalidOffsetNumber) LP_USED) == InvalidOffsetNumber)
elog(STOP, "btree: failed to add hikey to the left sibling"); elog(PANIC, "btree: failed to add hikey to the left sibling");
leftoff = OffsetNumberNext(leftoff); leftoff = OffsetNumberNext(leftoff);
/* /*
...@@ -1316,7 +1316,7 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf) ...@@ -1316,7 +1316,7 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
* the two items will go into positions P_HIKEY and P_FIRSTKEY. * the two items will go into positions P_HIKEY and P_FIRSTKEY.
*/ */
if (PageAddItem(rootpage, (Item) new_item, itemsz, P_HIKEY, LP_USED) == InvalidOffsetNumber) if (PageAddItem(rootpage, (Item) new_item, itemsz, P_HIKEY, LP_USED) == InvalidOffsetNumber)
elog(STOP, "btree: failed to add leftkey to new root page"); elog(PANIC, "btree: failed to add leftkey to new root page");
pfree(new_item); pfree(new_item);
/* /*
...@@ -1333,7 +1333,7 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf) ...@@ -1333,7 +1333,7 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
* insert the right page pointer into the new root page. * insert the right page pointer into the new root page.
*/ */
if (PageAddItem(rootpage, (Item) new_item, itemsz, P_FIRSTKEY, LP_USED) == InvalidOffsetNumber) if (PageAddItem(rootpage, (Item) new_item, itemsz, P_FIRSTKEY, LP_USED) == InvalidOffsetNumber)
elog(STOP, "btree: failed to add rightkey to new root page"); elog(PANIC, "btree: failed to add rightkey to new root page");
pfree(new_item); pfree(new_item);
metad->btm_root = rootblknum; metad->btm_root = rootblknum;
...@@ -2034,7 +2034,7 @@ _bt_pgaddtup(Relation rel, ...@@ -2034,7 +2034,7 @@ _bt_pgaddtup(Relation rel,
if (PageAddItem(page, (Item) btitem, itemsize, itup_off, if (PageAddItem(page, (Item) btitem, itemsize, itup_off,
LP_USED) == InvalidOffsetNumber) LP_USED) == InvalidOffsetNumber)
elog(STOP, "btree: failed to add item to the %s for %s", elog(PANIC, "btree: failed to add item to the %s for %s",
where, RelationGetRelationName(rel)); where, RelationGetRelationName(rel));
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.87 2002/01/06 00:37:43 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.88 2002/03/02 21:39:18 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -776,7 +776,7 @@ _bt_restore_page(Page page, char *from, int len) ...@@ -776,7 +776,7 @@ _bt_restore_page(Page page, char *from, int len)
itemsz = MAXALIGN(itemsz); itemsz = MAXALIGN(itemsz);
if (PageAddItem(page, (Item) from, itemsz, if (PageAddItem(page, (Item) from, itemsz,
FirstOffsetNumber, LP_USED) == InvalidOffsetNumber) FirstOffsetNumber, LP_USED) == InvalidOffsetNumber)
elog(STOP, "_bt_restore_page: can't add item to page"); elog(PANIC, "_bt_restore_page: can't add item to page");
from += itemsz; from += itemsz;
} }
} }
...@@ -799,10 +799,10 @@ btree_xlog_delete(bool redo, XLogRecPtr lsn, XLogRecord *record) ...@@ -799,10 +799,10 @@ btree_xlog_delete(bool redo, XLogRecPtr lsn, XLogRecord *record)
buffer = XLogReadBuffer(false, reln, buffer = XLogReadBuffer(false, reln,
ItemPointerGetBlockNumber(&(xlrec->target.tid))); ItemPointerGetBlockNumber(&(xlrec->target.tid)));
if (!BufferIsValid(buffer)) if (!BufferIsValid(buffer))
elog(STOP, "btree_delete_redo: block unfound"); elog(PANIC, "btree_delete_redo: block unfound");
page = (Page) BufferGetPage(buffer); page = (Page) BufferGetPage(buffer);
if (PageIsNew((PageHeader) page)) if (PageIsNew((PageHeader) page))
elog(STOP, "btree_delete_redo: uninitialized page"); elog(PANIC, "btree_delete_redo: uninitialized page");
if (XLByteLE(lsn, PageGetLSN(page))) if (XLByteLE(lsn, PageGetLSN(page)))
{ {
...@@ -838,10 +838,10 @@ btree_xlog_insert(bool redo, XLogRecPtr lsn, XLogRecord *record) ...@@ -838,10 +838,10 @@ btree_xlog_insert(bool redo, XLogRecPtr lsn, XLogRecord *record)
buffer = XLogReadBuffer(false, reln, buffer = XLogReadBuffer(false, reln,
ItemPointerGetBlockNumber(&(xlrec->target.tid))); ItemPointerGetBlockNumber(&(xlrec->target.tid)));
if (!BufferIsValid(buffer)) if (!BufferIsValid(buffer))
elog(STOP, "btree_insert_%sdo: block unfound", (redo) ? "re" : "un"); elog(PANIC, "btree_insert_%sdo: block unfound", (redo) ? "re" : "un");
page = (Page) BufferGetPage(buffer); page = (Page) BufferGetPage(buffer);
if (PageIsNew((PageHeader) page)) if (PageIsNew((PageHeader) page))
elog(STOP, "btree_insert_%sdo: uninitialized page", (redo) ? "re" : "un"); elog(PANIC, "btree_insert_%sdo: uninitialized page", (redo) ? "re" : "un");
pageop = (BTPageOpaque) PageGetSpecialPointer(page); pageop = (BTPageOpaque) PageGetSpecialPointer(page);
if (redo) if (redo)
...@@ -855,7 +855,7 @@ btree_xlog_insert(bool redo, XLogRecPtr lsn, XLogRecord *record) ...@@ -855,7 +855,7 @@ btree_xlog_insert(bool redo, XLogRecPtr lsn, XLogRecord *record)
record->xl_len - SizeOfBtreeInsert, record->xl_len - SizeOfBtreeInsert,
ItemPointerGetOffsetNumber(&(xlrec->target.tid)), ItemPointerGetOffsetNumber(&(xlrec->target.tid)),
LP_USED) == InvalidOffsetNumber) LP_USED) == InvalidOffsetNumber)
elog(STOP, "btree_insert_redo: failed to add item"); elog(PANIC, "btree_insert_redo: failed to add item");
PageSetLSN(page, lsn); PageSetLSN(page, lsn);
PageSetSUI(page, ThisStartUpID); PageSetSUI(page, ThisStartUpID);
...@@ -864,7 +864,7 @@ btree_xlog_insert(bool redo, XLogRecPtr lsn, XLogRecord *record) ...@@ -864,7 +864,7 @@ btree_xlog_insert(bool redo, XLogRecPtr lsn, XLogRecord *record)
else else
{ {
if (XLByteLT(PageGetLSN(page), lsn)) if (XLByteLT(PageGetLSN(page), lsn))
elog(STOP, "btree_insert_undo: bad page LSN"); elog(PANIC, "btree_insert_undo: bad page LSN");
if (!P_ISLEAF(pageop)) if (!P_ISLEAF(pageop))
{ {
...@@ -872,7 +872,7 @@ btree_xlog_insert(bool redo, XLogRecPtr lsn, XLogRecord *record) ...@@ -872,7 +872,7 @@ btree_xlog_insert(bool redo, XLogRecPtr lsn, XLogRecord *record)
return; return;
} }
elog(STOP, "btree_insert_undo: unimplemented"); elog(PANIC, "btree_insert_undo: unimplemented");
} }
return; return;
...@@ -899,13 +899,13 @@ btree_xlog_split(bool redo, bool onleft, XLogRecPtr lsn, XLogRecord *record) ...@@ -899,13 +899,13 @@ btree_xlog_split(bool redo, bool onleft, XLogRecPtr lsn, XLogRecord *record)
BlockIdGetBlockNumber(&(xlrec->otherblk)); BlockIdGetBlockNumber(&(xlrec->otherblk));
buffer = XLogReadBuffer(false, reln, blkno); buffer = XLogReadBuffer(false, reln, blkno);
if (!BufferIsValid(buffer)) if (!BufferIsValid(buffer))
elog(STOP, "btree_split_%s: lost left sibling", op); elog(PANIC, "btree_split_%s: lost left sibling", op);
page = (Page) BufferGetPage(buffer); page = (Page) BufferGetPage(buffer);
if (redo) if (redo)
_bt_pageinit(page, BufferGetPageSize(buffer)); _bt_pageinit(page, BufferGetPageSize(buffer));
else if (PageIsNew((PageHeader) page)) else if (PageIsNew((PageHeader) page))
elog(STOP, "btree_split_undo: uninitialized left sibling"); elog(PANIC, "btree_split_undo: uninitialized left sibling");
pageop = (BTPageOpaque) PageGetSpecialPointer(page); pageop = (BTPageOpaque) PageGetSpecialPointer(page);
if (redo) if (redo)
...@@ -928,8 +928,8 @@ btree_xlog_split(bool redo, bool onleft, XLogRecPtr lsn, XLogRecord *record) ...@@ -928,8 +928,8 @@ btree_xlog_split(bool redo, bool onleft, XLogRecPtr lsn, XLogRecord *record)
/* undo */ /* undo */
{ {
if (XLByteLT(PageGetLSN(page), lsn)) if (XLByteLT(PageGetLSN(page), lsn))
elog(STOP, "btree_split_undo: bad left sibling LSN"); elog(PANIC, "btree_split_undo: bad left sibling LSN");
elog(STOP, "btree_split_undo: unimplemented"); elog(PANIC, "btree_split_undo: unimplemented");
} }
/* Right (new) sibling */ /* Right (new) sibling */
...@@ -937,13 +937,13 @@ btree_xlog_split(bool redo, bool onleft, XLogRecPtr lsn, XLogRecord *record) ...@@ -937,13 +937,13 @@ btree_xlog_split(bool redo, bool onleft, XLogRecPtr lsn, XLogRecord *record)
ItemPointerGetBlockNumber(&(xlrec->target.tid)); ItemPointerGetBlockNumber(&(xlrec->target.tid));
buffer = XLogReadBuffer((redo) ? true : false, reln, blkno); buffer = XLogReadBuffer((redo) ? true : false, reln, blkno);
if (!BufferIsValid(buffer)) if (!BufferIsValid(buffer))
elog(STOP, "btree_split_%s: lost right sibling", op); elog(PANIC, "btree_split_%s: lost right sibling", op);
page = (Page) BufferGetPage(buffer); page = (Page) BufferGetPage(buffer);
if (redo) if (redo)
_bt_pageinit(page, BufferGetPageSize(buffer)); _bt_pageinit(page, BufferGetPageSize(buffer));
else if (PageIsNew((PageHeader) page)) else if (PageIsNew((PageHeader) page))
elog(STOP, "btree_split_undo: uninitialized right sibling"); elog(PANIC, "btree_split_undo: uninitialized right sibling");
pageop = (BTPageOpaque) PageGetSpecialPointer(page); pageop = (BTPageOpaque) PageGetSpecialPointer(page);
if (redo) if (redo)
...@@ -967,8 +967,8 @@ btree_xlog_split(bool redo, bool onleft, XLogRecPtr lsn, XLogRecord *record) ...@@ -967,8 +967,8 @@ btree_xlog_split(bool redo, bool onleft, XLogRecPtr lsn, XLogRecord *record)
/* undo */ /* undo */
{ {
if (XLByteLT(PageGetLSN(page), lsn)) if (XLByteLT(PageGetLSN(page), lsn))
elog(STOP, "btree_split_undo: bad right sibling LSN"); elog(PANIC, "btree_split_undo: bad right sibling LSN");
elog(STOP, "btree_split_undo: unimplemented"); elog(PANIC, "btree_split_undo: unimplemented");
} }
if (!redo || (record->xl_info & XLR_BKP_BLOCK_1)) if (!redo || (record->xl_info & XLR_BKP_BLOCK_1))
...@@ -981,11 +981,11 @@ btree_xlog_split(bool redo, bool onleft, XLogRecPtr lsn, XLogRecord *record) ...@@ -981,11 +981,11 @@ btree_xlog_split(bool redo, bool onleft, XLogRecPtr lsn, XLogRecord *record)
buffer = XLogReadBuffer(false, reln, blkno); buffer = XLogReadBuffer(false, reln, blkno);
if (!BufferIsValid(buffer)) if (!BufferIsValid(buffer))
elog(STOP, "btree_split_redo: lost next right page"); elog(PANIC, "btree_split_redo: lost next right page");
page = (Page) BufferGetPage(buffer); page = (Page) BufferGetPage(buffer);
if (PageIsNew((PageHeader) page)) if (PageIsNew((PageHeader) page))
elog(STOP, "btree_split_redo: uninitialized next right page"); elog(PANIC, "btree_split_redo: uninitialized next right page");
if (XLByteLE(lsn, PageGetLSN(page))) if (XLByteLE(lsn, PageGetLSN(page)))
{ {
...@@ -1022,10 +1022,10 @@ btree_xlog_newroot(bool redo, XLogRecPtr lsn, XLogRecord *record) ...@@ -1022,10 +1022,10 @@ btree_xlog_newroot(bool redo, XLogRecPtr lsn, XLogRecord *record)
return; return;
buffer = XLogReadBuffer(true, reln, BlockIdGetBlockNumber(&(xlrec->rootblk))); buffer = XLogReadBuffer(true, reln, BlockIdGetBlockNumber(&(xlrec->rootblk)));
if (!BufferIsValid(buffer)) if (!BufferIsValid(buffer))
elog(STOP, "btree_newroot_redo: no root page"); elog(PANIC, "btree_newroot_redo: no root page");
metabuf = XLogReadBuffer(false, reln, BTREE_METAPAGE); metabuf = XLogReadBuffer(false, reln, BTREE_METAPAGE);
if (!BufferIsValid(buffer)) if (!BufferIsValid(buffer))
elog(STOP, "btree_newroot_redo: no metapage"); elog(PANIC, "btree_newroot_redo: no metapage");
page = (Page) BufferGetPage(buffer); page = (Page) BufferGetPage(buffer);
_bt_pageinit(page, BufferGetPageSize(buffer)); _bt_pageinit(page, BufferGetPageSize(buffer));
pageop = (BTPageOpaque) PageGetSpecialPointer(page); pageop = (BTPageOpaque) PageGetSpecialPointer(page);
...@@ -1079,7 +1079,7 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -1079,7 +1079,7 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
else if (info == XLOG_BTREE_NEWROOT) else if (info == XLOG_BTREE_NEWROOT)
btree_xlog_newroot(true, lsn, record); btree_xlog_newroot(true, lsn, record);
else else
elog(STOP, "btree_redo: unknown op code %u", info); elog(PANIC, "btree_redo: unknown op code %u", info);
} }
void void
...@@ -1099,7 +1099,7 @@ btree_undo(XLogRecPtr lsn, XLogRecord *record) ...@@ -1099,7 +1099,7 @@ btree_undo(XLogRecPtr lsn, XLogRecord *record)
else if (info == XLOG_BTREE_NEWROOT) else if (info == XLOG_BTREE_NEWROOT)
btree_xlog_newroot(false, lsn, record); btree_xlog_newroot(false, lsn, record);
else else
elog(STOP, "btree_undo: unknown op code %u", info); elog(PANIC, "btree_undo: unknown op code %u", info);
} }
static void static void
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.69 2002/01/15 22:14:17 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.70 2002/03/02 21:39:19 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1345,13 +1345,13 @@ _rtdump(Relation r) ...@@ -1345,13 +1345,13 @@ _rtdump(Relation r)
void void
rtree_redo(XLogRecPtr lsn, XLogRecord *record) rtree_redo(XLogRecPtr lsn, XLogRecord *record)
{ {
elog(STOP, "rtree_redo: unimplemented"); elog(PANIC, "rtree_redo: unimplemented");
} }
void void
rtree_undo(XLogRecPtr lsn, XLogRecord *record) rtree_undo(XLogRecPtr lsn, XLogRecord *record)
{ {
elog(STOP, "rtree_undo: unimplemented"); elog(PANIC, "rtree_undo: unimplemented");
} }
void void
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Header: /cvsroot/pgsql/src/backend/access/transam/clog.c,v 1.7 2001/10/28 06:25:42 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/clog.c,v 1.8 2002/03/02 21:39:19 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -544,19 +544,19 @@ CLOGPhysicalReadPage(int pageno, int slotno) ...@@ -544,19 +544,19 @@ CLOGPhysicalReadPage(int pageno, int slotno)
if (fd < 0) if (fd < 0)
{ {
if (errno != ENOENT || !InRecovery) if (errno != ENOENT || !InRecovery)
elog(STOP, "open of %s failed: %m", path); elog(PANIC, "open of %s failed: %m", path);
elog(DEBUG, "clog file %s doesn't exist, reading as zeroes", path); elog(LOG, "clog file %s doesn't exist, reading as zeroes", path);
MemSet(ClogCtl->page_buffer[slotno], 0, CLOG_BLCKSZ); MemSet(ClogCtl->page_buffer[slotno], 0, CLOG_BLCKSZ);
return; return;
} }
if (lseek(fd, (off_t) offset, SEEK_SET) < 0) if (lseek(fd, (off_t) offset, SEEK_SET) < 0)
elog(STOP, "lseek of clog file %u, offset %u failed: %m", elog(PANIC, "lseek of clog file %u, offset %u failed: %m",
segno, offset); segno, offset);
errno = 0; errno = 0;
if (read(fd, ClogCtl->page_buffer[slotno], CLOG_BLCKSZ) != CLOG_BLCKSZ) if (read(fd, ClogCtl->page_buffer[slotno], CLOG_BLCKSZ) != CLOG_BLCKSZ)
elog(STOP, "read of clog file %u, offset %u failed: %m", elog(PANIC, "read of clog file %u, offset %u failed: %m",
segno, offset); segno, offset);
close(fd); close(fd);
...@@ -596,15 +596,15 @@ CLOGPhysicalWritePage(int pageno, int slotno) ...@@ -596,15 +596,15 @@ CLOGPhysicalWritePage(int pageno, int slotno)
if (fd < 0) if (fd < 0)
{ {
if (errno != ENOENT) if (errno != ENOENT)
elog(STOP, "open of %s failed: %m", path); elog(PANIC, "open of %s failed: %m", path);
fd = BasicOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY, fd = BasicOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY,
S_IRUSR | S_IWUSR); S_IRUSR | S_IWUSR);
if (fd < 0) if (fd < 0)
elog(STOP, "creation of file %s failed: %m", path); elog(PANIC, "creation of file %s failed: %m", path);
} }
if (lseek(fd, (off_t) offset, SEEK_SET) < 0) if (lseek(fd, (off_t) offset, SEEK_SET) < 0)
elog(STOP, "lseek of clog file %u, offset %u failed: %m", elog(PANIC, "lseek of clog file %u, offset %u failed: %m",
segno, offset); segno, offset);
errno = 0; errno = 0;
...@@ -613,7 +613,7 @@ CLOGPhysicalWritePage(int pageno, int slotno) ...@@ -613,7 +613,7 @@ CLOGPhysicalWritePage(int pageno, int slotno)
/* if write didn't set errno, assume problem is no disk space */ /* if write didn't set errno, assume problem is no disk space */
if (errno == 0) if (errno == 0)
errno = ENOSPC; errno = ENOSPC;
elog(STOP, "write of clog file %u, offset %u failed: %m", elog(PANIC, "write of clog file %u, offset %u failed: %m",
segno, offset); segno, offset);
} }
...@@ -887,7 +887,7 @@ ScanCLOGDirectory(int cutoffPage, bool doDeletions) ...@@ -887,7 +887,7 @@ ScanCLOGDirectory(int cutoffPage, bool doDeletions)
cldir = opendir(ClogDir); cldir = opendir(ClogDir);
if (cldir == NULL) if (cldir == NULL)
elog(STOP, "could not open transaction-commit log directory (%s): %m", elog(PANIC, "could not open transaction-commit log directory (%s): %m",
ClogDir); ClogDir);
errno = 0; errno = 0;
...@@ -912,7 +912,7 @@ ScanCLOGDirectory(int cutoffPage, bool doDeletions) ...@@ -912,7 +912,7 @@ ScanCLOGDirectory(int cutoffPage, bool doDeletions)
errno = 0; errno = 0;
} }
if (errno) if (errno)
elog(STOP, "could not read transaction-commit log directory (%s): %m", elog(PANIC, "could not read transaction-commit log directory (%s): %m",
ClogDir); ClogDir);
closedir(cldir); closedir(cldir);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.115 2001/11/01 06:17:01 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.116 2002/03/02 21:39:19 momjian Exp $
* *
* NOTES * NOTES
* Transaction aborts can now occur two ways: * Transaction aborts can now occur two ways:
...@@ -1606,7 +1606,7 @@ xact_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -1606,7 +1606,7 @@ xact_redo(XLogRecPtr lsn, XLogRecord *record)
/* SHOULD REMOVE FILES OF ALL FAILED-TO-BE-CREATED RELATIONS */ /* SHOULD REMOVE FILES OF ALL FAILED-TO-BE-CREATED RELATIONS */
} }
else else
elog(STOP, "xact_redo: unknown op code %u", info); elog(PANIC, "xact_redo: unknown op code %u", info);
} }
void void
...@@ -1615,9 +1615,9 @@ xact_undo(XLogRecPtr lsn, XLogRecord *record) ...@@ -1615,9 +1615,9 @@ xact_undo(XLogRecPtr lsn, XLogRecord *record)
uint8 info = record->xl_info & ~XLR_INFO_MASK; uint8 info = record->xl_info & ~XLR_INFO_MASK;
if (info == XLOG_XACT_COMMIT) /* shouldn't be called by XLOG */ if (info == XLOG_XACT_COMMIT) /* shouldn't be called by XLOG */
elog(STOP, "xact_undo: can't undo committed xaction"); elog(PANIC, "xact_undo: can't undo committed xaction");
else if (info != XLOG_XACT_ABORT) else if (info != XLOG_XACT_ABORT)
elog(STOP, "xact_redo: unknown op code %u", info); elog(PANIC, "xact_redo: unknown op code %u", info);
} }
void void
...@@ -1652,7 +1652,7 @@ void ...@@ -1652,7 +1652,7 @@ void
{ {
#ifdef XLOG_II #ifdef XLOG_II
if (_RollbackFunc != NULL) if (_RollbackFunc != NULL)
elog(STOP, "XactPushRollback: already installed"); elog(PANIC, "XactPushRollback: already installed");
#endif #endif
_RollbackFunc = func; _RollbackFunc = func;
......
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlogutils.c,v 1.21 2001/10/25 05:49:22 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlogutils.c,v 1.22 2002/03/02 21:39:20 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -249,7 +249,7 @@ _xl_remove_hash_entry(XLogRelDesc *rdesc) ...@@ -249,7 +249,7 @@ _xl_remove_hash_entry(XLogRelDesc *rdesc)
hentry = (XLogRelCacheEntry *) hash_search(_xlrelcache, hentry = (XLogRelCacheEntry *) hash_search(_xlrelcache,
(void *) &(rdesc->reldata.rd_node), HASH_REMOVE, NULL); (void *) &(rdesc->reldata.rd_node), HASH_REMOVE, NULL);
if (hentry == NULL) if (hentry == NULL)
elog(STOP, "_xl_remove_hash_entry: file was not found in cache"); elog(PANIC, "_xl_remove_hash_entry: file was not found in cache");
if (rdesc->reldata.rd_fd >= 0) if (rdesc->reldata.rd_fd >= 0)
smgrclose(DEFAULT_SMGR, &(rdesc->reldata)); smgrclose(DEFAULT_SMGR, &(rdesc->reldata));
...@@ -346,10 +346,10 @@ XLogOpenRelation(bool redo, RmgrId rmid, RelFileNode rnode) ...@@ -346,10 +346,10 @@ XLogOpenRelation(bool redo, RmgrId rmid, RelFileNode rnode)
hash_search(_xlrelcache, (void *) &rnode, HASH_ENTER, &found); hash_search(_xlrelcache, (void *) &rnode, HASH_ENTER, &found);
if (hentry == NULL) if (hentry == NULL)
elog(STOP, "XLogOpenRelation: out of memory for cache"); elog(PANIC, "XLogOpenRelation: out of memory for cache");
if (found) if (found)
elog(STOP, "XLogOpenRelation: file found on insert into cache"); elog(PANIC, "XLogOpenRelation: file found on insert into cache");
hentry->rdesc = res; hentry->rdesc = res;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.39 2001/09/29 04:02:22 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.40 2002/03/02 21:39:20 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -54,8 +54,7 @@ static void ...@@ -54,8 +54,7 @@ static void
do_start() do_start()
{ {
StartTransactionCommand(); StartTransactionCommand();
if (DebugMode) elog(DEBUG3, "start transaction");
elog(DEBUG, "start transaction");
} }
...@@ -63,8 +62,7 @@ static void ...@@ -63,8 +62,7 @@ static void
do_end() do_end()
{ {
CommitTransactionCommand(); CommitTransactionCommand();
if (DebugMode) elog(DEBUG3, "commit transaction");
elog(DEBUG, "commit transaction");
if (isatty(0)) if (isatty(0))
{ {
printf("bootstrap> "); printf("bootstrap> ");
...@@ -154,15 +152,12 @@ Boot_CreateStmt: ...@@ -154,15 +152,12 @@ Boot_CreateStmt:
{ {
do_start(); do_start();
numattr = 0; numattr = 0;
if (DebugMode) if ($2)
{ elog(DEBUG3, "creating bootstrap relation %s...",
if ($2) LexIDStr($4));
elog(DEBUG, "creating bootstrap relation %s...", else
LexIDStr($4)); elog(DEBUG3, "creating relation %s...",
else LexIDStr($4));
elog(DEBUG, "creating relation %s...",
LexIDStr($4));
}
} }
boot_typelist boot_typelist
{ {
...@@ -179,7 +174,7 @@ Boot_CreateStmt: ...@@ -179,7 +174,7 @@ Boot_CreateStmt:
if (reldesc) if (reldesc)
{ {
elog(DEBUG, "create bootstrap: warning, open relation exists, closing first"); elog(DEBUG3, "create bootstrap: warning, open relation exists, closing first");
closerel(NULL); closerel(NULL);
} }
...@@ -187,8 +182,7 @@ Boot_CreateStmt: ...@@ -187,8 +182,7 @@ Boot_CreateStmt:
reldesc = heap_create(LexIDStr($4), tupdesc, reldesc = heap_create(LexIDStr($4), tupdesc,
false, true, true); false, true, true);
reldesc->rd_rel->relhasoids = ! ($3); reldesc->rd_rel->relhasoids = ! ($3);
if (DebugMode) elog(DEBUG3, "bootstrap relation created");
elog(DEBUG, "bootstrap relation created");
} }
else else
{ {
...@@ -202,8 +196,7 @@ Boot_CreateStmt: ...@@ -202,8 +196,7 @@ Boot_CreateStmt:
! ($3), ! ($3),
false, false,
true); true);
if (DebugMode) elog(DEBUG3, "relation created with oid %u", id);
elog(DEBUG, "relation created with oid %u", id);
} }
do_end(); do_end();
} }
...@@ -213,13 +206,10 @@ Boot_InsertStmt: ...@@ -213,13 +206,10 @@ Boot_InsertStmt:
INSERT_TUPLE optoideq INSERT_TUPLE optoideq
{ {
do_start(); do_start();
if (DebugMode) if ($2)
{ elog(DEBUG3, "inserting row with oid %u...", $2);
if ($2) else
elog(DEBUG, "inserting row with oid %u...", $2); elog(DEBUG3, "inserting row...");
else
elog(DEBUG, "inserting row...");
}
num_columns_read = 0; num_columns_read = 0;
} }
LPAREN boot_tuplelist RPAREN LPAREN boot_tuplelist RPAREN
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.121 2002/02/23 01:31:34 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.122 2002/03/02 21:39:21 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -140,8 +140,6 @@ Form_pg_attribute attrtypes[MAXATTR]; /* points to attribute info */ ...@@ -140,8 +140,6 @@ Form_pg_attribute attrtypes[MAXATTR]; /* points to attribute info */
static Datum values[MAXATTR]; /* corresponding attribute values */ static Datum values[MAXATTR]; /* corresponding attribute values */
int numattr; /* number of attributes for cur. rel */ int numattr; /* number of attributes for cur. rel */
int DebugMode;
static MemoryContext nogc = NULL; /* special no-gc mem context */ static MemoryContext nogc = NULL; /* special no-gc mem context */
extern int optind; extern int optind;
...@@ -188,8 +186,8 @@ usage(void) ...@@ -188,8 +186,8 @@ usage(void)
{ {
fprintf(stderr, fprintf(stderr,
gettext("Usage:\n" gettext("Usage:\n"
" postgres -boot [-d] [-D datadir] [-F] [-o file] [-x num] dbname\n" " postgres -boot [-d level] [-D datadir] [-F] [-o file] [-x num] dbname\n"
" -d debug mode\n" " -d 1-5 debug mode\n"
" -D datadir data directory\n" " -D datadir data directory\n"
" -F turn off fsync\n" " -F turn off fsync\n"
" -o file send debug output to file\n" " -o file send debug output to file\n"
...@@ -258,9 +256,17 @@ BootstrapMain(int argc, char *argv[]) ...@@ -258,9 +256,17 @@ BootstrapMain(int argc, char *argv[])
potential_DataDir = optarg; potential_DataDir = optarg;
break; break;
case 'd': case 'd':
DebugMode = true; /* print out debugging info while {
* parsing */ /* Turn on debugging for the postmaster. */
char *debugstr = palloc(strlen("debug") + strlen(optarg) + 1);
sprintf(debugstr, "debug%s", optarg);
/* We use PGC_S_SESSION because we will reset in backend */
SetConfigOption("server_min_messages", debugstr, PGC_POSTMASTER, PGC_S_ARGV);
SetConfigOption("client_min_messages", debugstr, PGC_POSTMASTER, PGC_S_ARGV);
pfree(debugstr);
break; break;
}
break;
case 'F': case 'F':
SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV);
break; break;
...@@ -392,7 +398,7 @@ BootstrapMain(int argc, char *argv[]) ...@@ -392,7 +398,7 @@ BootstrapMain(int argc, char *argv[])
proc_exit(0); /* done */ proc_exit(0); /* done */
default: default:
elog(STOP, "Unsupported XLOG op %d", xlogop); elog(PANIC, "Unsupported XLOG op %d", xlogop);
proc_exit(0); proc_exit(0);
} }
...@@ -495,9 +501,8 @@ boot_openrel(char *relname) ...@@ -495,9 +501,8 @@ boot_openrel(char *relname)
if (reldesc != NULL) if (reldesc != NULL)
closerel(NULL); closerel(NULL);
if (DebugMode) elog(DEBUG3, "open relation %s, attrsize %d", relname ? relname : "(null)",
elog(DEBUG, "open relation %s, attrsize %d", relname ? relname : "(null)", (int) ATTRIBUTE_TUPLE_SIZE);
(int) ATTRIBUTE_TUPLE_SIZE);
reldesc = heap_openr(relname, NoLock); reldesc = heap_openr(relname, NoLock);
numattr = reldesc->rd_rel->relnatts; numattr = reldesc->rd_rel->relnatts;
...@@ -521,14 +526,12 @@ boot_openrel(char *relname) ...@@ -521,14 +526,12 @@ boot_openrel(char *relname)
else else
attrtypes[i]->attisset = false; attrtypes[i]->attisset = false;
if (DebugMode)
{ {
Form_pg_attribute at = attrtypes[i]; Form_pg_attribute at = attrtypes[i];
elog(DEBUG, "create attribute %d name %s len %d num %d type %u", elog(DEBUG3, "create attribute %d name %s len %d num %d type %u",
i, NameStr(at->attname), at->attlen, at->attnum, i, NameStr(at->attname), at->attlen, at->attnum,
at->atttypid at->atttypid);
);
} }
} }
} }
...@@ -558,8 +561,7 @@ closerel(char *name) ...@@ -558,8 +561,7 @@ closerel(char *name)
elog(ERROR, "no open relation to close"); elog(ERROR, "no open relation to close");
else else
{ {
if (DebugMode) elog(DEBUG3, "close relation %s", relname ? relname : "(null)");
elog(DEBUG, "close relation %s", relname ? relname : "(null)");
heap_close(reldesc, NoLock); heap_close(reldesc, NoLock);
reldesc = (Relation) NULL; reldesc = (Relation) NULL;
} }
...@@ -583,7 +585,7 @@ DefineAttr(char *name, char *type, int attnum) ...@@ -583,7 +585,7 @@ DefineAttr(char *name, char *type, int attnum)
if (reldesc != NULL) if (reldesc != NULL)
{ {
elog(DEBUG, "warning: no open relations allowed with 'create' command"); elog(LOG, "warning: no open relations allowed with 'create' command");
closerel(relname); closerel(relname);
} }
...@@ -594,8 +596,7 @@ DefineAttr(char *name, char *type, int attnum) ...@@ -594,8 +596,7 @@ DefineAttr(char *name, char *type, int attnum)
{ {
attrtypes[attnum]->atttypid = Ap->am_oid; attrtypes[attnum]->atttypid = Ap->am_oid;
namestrcpy(&attrtypes[attnum]->attname, name); namestrcpy(&attrtypes[attnum]->attname, name);
if (DebugMode) elog(DEBUG3, "column %s %s", NameStr(attrtypes[attnum]->attname), type);
elog(DEBUG, "column %s %s", NameStr(attrtypes[attnum]->attname), type);
attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */ attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */
attlen = attrtypes[attnum]->attlen = Ap->am_typ.typlen; attlen = attrtypes[attnum]->attlen = Ap->am_typ.typlen;
attrtypes[attnum]->attbyval = Ap->am_typ.typbyval; attrtypes[attnum]->attbyval = Ap->am_typ.typbyval;
...@@ -606,8 +607,7 @@ DefineAttr(char *name, char *type, int attnum) ...@@ -606,8 +607,7 @@ DefineAttr(char *name, char *type, int attnum)
{ {
attrtypes[attnum]->atttypid = Procid[typeoid].oid; attrtypes[attnum]->atttypid = Procid[typeoid].oid;
namestrcpy(&attrtypes[attnum]->attname, name); namestrcpy(&attrtypes[attnum]->attname, name);
if (DebugMode) elog(DEBUG3, "column %s %s", NameStr(attrtypes[attnum]->attname), type);
elog(DEBUG, "column %s %s", NameStr(attrtypes[attnum]->attname), type);
attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */ attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */
attlen = attrtypes[attnum]->attlen = Procid[typeoid].len; attlen = attrtypes[attnum]->attlen = Procid[typeoid].len;
attrtypes[attnum]->attstorage = 'p'; attrtypes[attnum]->attstorage = 'p';
...@@ -655,8 +655,7 @@ InsertOneTuple(Oid objectid) ...@@ -655,8 +655,7 @@ InsertOneTuple(Oid objectid)
TupleDesc tupDesc; TupleDesc tupDesc;
int i; int i;
if (DebugMode) elog(DEBUG3, "inserting row oid %u, %d columns", objectid, numattr);
elog(DEBUG, "inserting row oid %u, %d columns", objectid, numattr);
tupDesc = CreateTupleDesc(numattr, attrtypes); tupDesc = CreateTupleDesc(numattr, attrtypes);
tuple = heap_formtuple(tupDesc, values, Blanks); tuple = heap_formtuple(tupDesc, values, Blanks);
...@@ -666,8 +665,7 @@ InsertOneTuple(Oid objectid) ...@@ -666,8 +665,7 @@ InsertOneTuple(Oid objectid)
tuple->t_data->t_oid = objectid; tuple->t_data->t_oid = objectid;
heap_insert(reldesc, tuple); heap_insert(reldesc, tuple);
heap_freetuple(tuple); heap_freetuple(tuple);
if (DebugMode) elog(DEBUG3, "row inserted");
elog(DEBUG, "row inserted");
/* /*
* Reset blanks for next tuple * Reset blanks for next tuple
...@@ -689,15 +687,13 @@ InsertOneValue(char *value, int i) ...@@ -689,15 +687,13 @@ InsertOneValue(char *value, int i)
AssertArg(i >= 0 || i < MAXATTR); AssertArg(i >= 0 || i < MAXATTR);
if (DebugMode) elog(DEBUG3, "inserting column %d value '%s'", i, value);
elog(DEBUG, "inserting column %d value '%s'", i, value);
if (Typ != (struct typmap **) NULL) if (Typ != (struct typmap **) NULL)
{ {
struct typmap *ap; struct typmap *ap;
if (DebugMode) elog(DEBUG3, "Typ != NULL");
elog(DEBUG, "Typ != NULL");
app = Typ; app = Typ;
while (*app && (*app)->am_oid != reldesc->rd_att->attrs[i]->atttypid) while (*app && (*app)->am_oid != reldesc->rd_att->attrs[i]->atttypid)
++app; ++app;
...@@ -715,8 +711,7 @@ InsertOneValue(char *value, int i) ...@@ -715,8 +711,7 @@ InsertOneValue(char *value, int i)
values[i], values[i],
ObjectIdGetDatum(ap->am_typ.typelem), ObjectIdGetDatum(ap->am_typ.typelem),
Int32GetDatum(-1))); Int32GetDatum(-1)));
if (DebugMode) elog(DEBUG3, " -> %s", prt);
elog(DEBUG, " -> %s", prt);
pfree(prt); pfree(prt);
} }
else else
...@@ -728,8 +723,7 @@ InsertOneValue(char *value, int i) ...@@ -728,8 +723,7 @@ InsertOneValue(char *value, int i)
} }
if (typeindex >= n_types) if (typeindex >= n_types)
elog(ERROR, "type oid %u not found", attrtypes[i]->atttypid); elog(ERROR, "type oid %u not found", attrtypes[i]->atttypid);
if (DebugMode) elog(DEBUG3, "Typ == NULL, typeindex = %u", typeindex);
elog(DEBUG, "Typ == NULL, typeindex = %u", typeindex);
values[i] = OidFunctionCall3(Procid[typeindex].inproc, values[i] = OidFunctionCall3(Procid[typeindex].inproc,
CStringGetDatum(value), CStringGetDatum(value),
ObjectIdGetDatum(Procid[typeindex].elem), ObjectIdGetDatum(Procid[typeindex].elem),
...@@ -738,12 +732,10 @@ InsertOneValue(char *value, int i) ...@@ -738,12 +732,10 @@ InsertOneValue(char *value, int i)
values[i], values[i],
ObjectIdGetDatum(Procid[typeindex].elem), ObjectIdGetDatum(Procid[typeindex].elem),
Int32GetDatum(-1))); Int32GetDatum(-1)));
if (DebugMode) elog(DEBUG3, " -> %s", prt);
elog(DEBUG, " -> %s", prt);
pfree(prt); pfree(prt);
} }
if (DebugMode) elog(DEBUG3, "inserted");
elog(DEBUG, "inserted");
} }
/* ---------------- /* ----------------
...@@ -753,8 +745,7 @@ InsertOneValue(char *value, int i) ...@@ -753,8 +745,7 @@ InsertOneValue(char *value, int i)
void void
InsertOneNull(int i) InsertOneNull(int i)
{ {
if (DebugMode) elog(DEBUG3, "inserting column %d NULL", i);
elog(DEBUG, "inserting column %d NULL", i);
Assert(i >= 0 || i < MAXATTR); Assert(i >= 0 || i < MAXATTR);
values[i] = PointerGetDatum(NULL); values[i] = PointerGetDatum(NULL);
Blanks[i] = 'n'; Blanks[i] = 'n';
...@@ -841,8 +832,7 @@ gettype(char *type) ...@@ -841,8 +832,7 @@ gettype(char *type)
if (strncmp(type, Procid[i].name, NAMEDATALEN) == 0) if (strncmp(type, Procid[i].name, NAMEDATALEN) == 0)
return i; return i;
} }
if (DebugMode) elog(DEBUG3, "external type: %s", type);
elog(DEBUG, "external type: %s", type);
rel = heap_openr(TypeRelationName, NoLock); rel = heap_openr(TypeRelationName, NoLock);
scan = heap_beginscan(rel, 0, SnapshotNow, 0, (ScanKey) NULL); scan = heap_beginscan(rel, 0, SnapshotNow, 0, (ScanKey) NULL);
i = 0; i = 0;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.54 2002/02/18 23:11:07 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.55 2002/03/02 21:39:22 momjian Exp $
* *
* NOTES * NOTES
* See acl.h. * See acl.h.
...@@ -66,11 +66,11 @@ dumpacl(Acl *acl) ...@@ -66,11 +66,11 @@ dumpacl(Acl *acl)
int i; int i;
AclItem *aip; AclItem *aip;
elog(DEBUG, "acl size = %d, # acls = %d", elog(LOG, "acl size = %d, # acls = %d",
ACL_SIZE(acl), ACL_NUM(acl)); ACL_SIZE(acl), ACL_NUM(acl));
aip = ACL_DAT(acl); aip = ACL_DAT(acl);
for (i = 0; i < ACL_NUM(acl); ++i) for (i = 0; i < ACL_NUM(acl); ++i)
elog(DEBUG, " acl[%d]: %s", i, elog(LOG, " acl[%d]: %s", i,
DatumGetCString(DirectFunctionCall1(aclitemout, DatumGetCString(DirectFunctionCall1(aclitemout,
PointerGetDatum(aip + i)))); PointerGetDatum(aip + i))));
} }
...@@ -291,7 +291,7 @@ find_function_with_arglist(char *name, List *arguments) ...@@ -291,7 +291,7 @@ find_function_with_arglist(char *name, List *arguments)
Oid argoids[FUNC_MAX_ARGS]; Oid argoids[FUNC_MAX_ARGS];
int i; int i;
int16 argcount; int16 argcount;
MemSet(argoids, 0, FUNC_MAX_ARGS * sizeof(Oid)); MemSet(argoids, 0, FUNC_MAX_ARGS * sizeof(Oid));
argcount = length(arguments); argcount = length(arguments);
if (argcount > FUNC_MAX_ARGS) if (argcount > FUNC_MAX_ARGS)
...@@ -302,9 +302,9 @@ find_function_with_arglist(char *name, List *arguments) ...@@ -302,9 +302,9 @@ find_function_with_arglist(char *name, List *arguments)
{ {
TypeName *t = (TypeName *) lfirst(arguments); TypeName *t = (TypeName *) lfirst(arguments);
char *typnam = TypeNameToInternalName(t); char *typnam = TypeNameToInternalName(t);
arguments = lnext(arguments); arguments = lnext(arguments);
if (strcmp(typnam, "opaque") == 0) if (strcmp(typnam, "opaque") == 0)
argoids[i] = InvalidOid; argoids[i] = InvalidOid;
else else
...@@ -327,7 +327,7 @@ find_function_with_arglist(char *name, List *arguments) ...@@ -327,7 +327,7 @@ find_function_with_arglist(char *name, List *arguments)
func_error(NULL, name, argcount, argoids, NULL); func_error(NULL, name, argcount, argoids, NULL);
return oid; return oid;
} }
static void static void
...@@ -658,7 +658,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode) ...@@ -658,7 +658,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode)
*/ */
if (!acl) if (!acl)
{ {
elog(DEBUG, "aclcheck: null ACL, returning OK"); elog(LOG, "aclcheck: null ACL, returning OK");
return ACLCHECK_OK; return ACLCHECK_OK;
} }
...@@ -673,7 +673,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode) ...@@ -673,7 +673,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode)
*/ */
if (num < 1) if (num < 1)
{ {
elog(DEBUG, "aclcheck: zero-length ACL, returning OK"); elog(LOG, "aclcheck: zero-length ACL, returning OK");
return ACLCHECK_OK; return ACLCHECK_OK;
} }
...@@ -686,7 +686,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode) ...@@ -686,7 +686,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode)
if (aidat->ai_mode & mode) if (aidat->ai_mode & mode)
{ {
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "aclcheck: using world=%d", aidat->ai_mode); elog(LOG, "aclcheck: using world=%d", aidat->ai_mode);
#endif #endif
return ACLCHECK_OK; return ACLCHECK_OK;
} }
...@@ -702,7 +702,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode) ...@@ -702,7 +702,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode)
if (aip->ai_id == id) if (aip->ai_id == id)
{ {
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "aclcheck: found user %u/%d", elog(LOG, "aclcheck: found user %u/%d",
aip->ai_id, aip->ai_mode); aip->ai_id, aip->ai_mode);
#endif #endif
if (aip->ai_mode & mode) if (aip->ai_mode & mode)
...@@ -719,7 +719,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode) ...@@ -719,7 +719,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode)
if (in_group(id, aip->ai_id)) if (in_group(id, aip->ai_id))
{ {
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "aclcheck: found group %u/%d", elog(LOG, "aclcheck: found group %u/%d",
aip->ai_id, aip->ai_mode); aip->ai_id, aip->ai_mode);
#endif #endif
return ACLCHECK_OK; return ACLCHECK_OK;
...@@ -740,7 +740,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode) ...@@ -740,7 +740,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode)
if (aip->ai_id == id) if (aip->ai_id == id)
{ {
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "aclcheck: found group %u/%d", elog(LOG, "aclcheck: found group %u/%d",
aip->ai_id, aip->ai_mode); aip->ai_id, aip->ai_mode);
#endif #endif
if (aip->ai_mode & mode) if (aip->ai_mode & mode)
...@@ -798,7 +798,7 @@ pg_aclcheck(char *relname, Oid userid, AclMode mode) ...@@ -798,7 +798,7 @@ pg_aclcheck(char *relname, Oid userid, AclMode mode)
!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd) !((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)
{ {
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "pg_aclcheck: catalog update to \"%s\": permission denied", elog(LOG, "pg_aclcheck: catalog update to \"%s\": permission denied",
relname); relname);
#endif #endif
ReleaseSysCache(tuple); ReleaseSysCache(tuple);
...@@ -811,7 +811,7 @@ pg_aclcheck(char *relname, Oid userid, AclMode mode) ...@@ -811,7 +811,7 @@ pg_aclcheck(char *relname, Oid userid, AclMode mode)
if (((Form_pg_shadow) GETSTRUCT(tuple))->usesuper) if (((Form_pg_shadow) GETSTRUCT(tuple))->usesuper)
{ {
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "pg_aclcheck: \"%s\" is superuser", elog(LOG, "pg_aclcheck: \"%s\" is superuser",
usename); usename);
#endif #endif
ReleaseSysCache(tuple); ReleaseSysCache(tuple);
...@@ -888,7 +888,7 @@ pg_ownercheck(Oid userid, ...@@ -888,7 +888,7 @@ pg_ownercheck(Oid userid,
if (((Form_pg_shadow) GETSTRUCT(tuple))->usesuper) if (((Form_pg_shadow) GETSTRUCT(tuple))->usesuper)
{ {
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "pg_ownercheck: user \"%s\" is superuser", elog(LOG, "pg_ownercheck: user \"%s\" is superuser",
usename); usename);
#endif #endif
ReleaseSysCache(tuple); ReleaseSysCache(tuple);
...@@ -950,7 +950,7 @@ pg_oper_ownercheck(Oid userid, Oid oprid) ...@@ -950,7 +950,7 @@ pg_oper_ownercheck(Oid userid, Oid oprid)
if (((Form_pg_shadow) GETSTRUCT(tuple))->usesuper) if (((Form_pg_shadow) GETSTRUCT(tuple))->usesuper)
{ {
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "pg_ownercheck: user \"%s\" is superuser", elog(LOG, "pg_ownercheck: user \"%s\" is superuser",
usename); usename);
#endif #endif
ReleaseSysCache(tuple); ReleaseSysCache(tuple);
...@@ -1001,7 +1001,7 @@ pg_func_ownercheck(Oid userid, ...@@ -1001,7 +1001,7 @@ pg_func_ownercheck(Oid userid,
if (((Form_pg_shadow) GETSTRUCT(tuple))->usesuper) if (((Form_pg_shadow) GETSTRUCT(tuple))->usesuper)
{ {
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "pg_ownercheck: user \"%s\" is superuser", elog(LOG, "pg_ownercheck: user \"%s\" is superuser",
usename); usename);
#endif #endif
ReleaseSysCache(tuple); ReleaseSysCache(tuple);
...@@ -1053,7 +1053,7 @@ pg_aggr_ownercheck(Oid userid, ...@@ -1053,7 +1053,7 @@ pg_aggr_ownercheck(Oid userid,
if (((Form_pg_shadow) GETSTRUCT(tuple))->usesuper) if (((Form_pg_shadow) GETSTRUCT(tuple))->usesuper)
{ {
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "pg_aggr_ownercheck: user \"%s\" is superuser", elog(LOG, "pg_aggr_ownercheck: user \"%s\" is superuser",
usename); usename);
#endif #endif
ReleaseSysCache(tuple); ReleaseSysCache(tuple);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 ...@@ -105,8 +105,7 @@ typedef struct
#define swapInt(a,b) do {int _tmp; _tmp=a; a=b; b=_tmp;} while(0) #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) #define swapDatum(a,b) do {Datum _tmp; _tmp=a; a=b; b=_tmp;} while(0)
static int elevel = -1;
static int MESSAGE_LEVEL;
/* context information for compare_scalars() */ /* context information for compare_scalars() */
static FmgrInfo *datumCmpFn; static FmgrInfo *datumCmpFn;
...@@ -151,10 +150,10 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt) ...@@ -151,10 +150,10 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt)
HeapTuple tuple; HeapTuple tuple;
if (vacstmt->verbose) if (vacstmt->verbose)
MESSAGE_LEVEL = NOTICE; elevel = INFO;
else else
MESSAGE_LEVEL = DEBUG; elevel = DEBUG1;
/* /*
* Begin a transaction for analyzing this relation. * Begin a transaction for analyzing this relation.
* *
...@@ -214,7 +213,7 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt) ...@@ -214,7 +213,7 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt)
return; return;
} }
elog(MESSAGE_LEVEL, "Analyzing %s", RelationGetRelationName(onerel)); elog(elevel, "Analyzing %s", RelationGetRelationName(onerel));
/* /*
* Determine which columns to analyze * Determine which columns to analyze
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * 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 ...@@ -150,7 +150,7 @@ void
Async_Notify(char *relname) Async_Notify(char *relname)
{ {
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "Async_Notify: %s", relname); elog(LOG, "Async_Notify: %s", relname);
/* no point in making duplicate entries in the list ... */ /* no point in making duplicate entries in the list ... */
if (!AsyncExistsPendingNotify(relname)) if (!AsyncExistsPendingNotify(relname))
...@@ -198,7 +198,7 @@ Async_Listen(char *relname, int pid) ...@@ -198,7 +198,7 @@ Async_Listen(char *relname, int pid)
bool alreadyListener = false; bool alreadyListener = false;
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "Async_Listen: %s", relname); elog(LOG, "Async_Listen: %s", relname);
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock); lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
...@@ -300,7 +300,7 @@ Async_Unlisten(char *relname, int pid) ...@@ -300,7 +300,7 @@ Async_Unlisten(char *relname, int pid)
} }
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "Async_Unlisten %s", relname); elog(LOG, "Async_Unlisten %s", relname);
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock); lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
...@@ -358,7 +358,7 @@ Async_UnlistenAll(void) ...@@ -358,7 +358,7 @@ Async_UnlistenAll(void)
ScanKeyData key[1]; ScanKeyData key[1];
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "Async_UnlistenAll"); elog(LOG, "Async_UnlistenAll");
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock); lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
tdesc = RelationGetDescr(lRel); tdesc = RelationGetDescr(lRel);
...@@ -460,7 +460,7 @@ AtCommit_Notify(void) ...@@ -460,7 +460,7 @@ AtCommit_Notify(void)
} }
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "AtCommit_Notify"); elog(LOG, "AtCommit_Notify");
/* preset data to update notify column to MyProcPid */ /* preset data to update notify column to MyProcPid */
nulls[0] = nulls[1] = nulls[2] = ' '; nulls[0] = nulls[1] = nulls[2] = ' ';
...@@ -492,14 +492,14 @@ AtCommit_Notify(void) ...@@ -492,14 +492,14 @@ AtCommit_Notify(void)
*/ */
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "AtCommit_Notify: notifying self"); elog(LOG, "AtCommit_Notify: notifying self");
NotifyMyFrontEnd(relname, listenerPID); NotifyMyFrontEnd(relname, listenerPID);
} }
else else
{ {
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "AtCommit_Notify: notifying pid %d", elog(LOG, "AtCommit_Notify: notifying pid %d",
listenerPID); listenerPID);
/* /*
...@@ -555,7 +555,7 @@ AtCommit_Notify(void) ...@@ -555,7 +555,7 @@ AtCommit_Notify(void)
ClearPendingNotifies(); ClearPendingNotifies();
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "AtCommit_Notify: done"); elog(LOG, "AtCommit_Notify: done");
} }
/* /*
...@@ -628,12 +628,12 @@ Async_NotifyHandler(SIGNAL_ARGS) ...@@ -628,12 +628,12 @@ Async_NotifyHandler(SIGNAL_ARGS)
{ {
/* Here, it is finally safe to do stuff. */ /* Here, it is finally safe to do stuff. */
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "Async_NotifyHandler: perform async notify"); elog(LOG, "Async_NotifyHandler: perform async notify");
ProcessIncomingNotify(); ProcessIncomingNotify();
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "Async_NotifyHandler: done"); elog(LOG, "Async_NotifyHandler: done");
} }
} }
} }
...@@ -700,12 +700,12 @@ EnableNotifyInterrupt(void) ...@@ -700,12 +700,12 @@ EnableNotifyInterrupt(void)
if (notifyInterruptOccurred) if (notifyInterruptOccurred)
{ {
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "EnableNotifyInterrupt: perform async notify"); elog(LOG, "EnableNotifyInterrupt: perform async notify");
ProcessIncomingNotify(); ProcessIncomingNotify();
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "EnableNotifyInterrupt: done"); elog(LOG, "EnableNotifyInterrupt: done");
} }
} }
} }
...@@ -756,7 +756,7 @@ ProcessIncomingNotify(void) ...@@ -756,7 +756,7 @@ ProcessIncomingNotify(void)
nulls[Natts_pg_listener]; nulls[Natts_pg_listener];
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "ProcessIncomingNotify"); elog(LOG, "ProcessIncomingNotify");
set_ps_display("async_notify"); set_ps_display("async_notify");
...@@ -792,7 +792,7 @@ ProcessIncomingNotify(void) ...@@ -792,7 +792,7 @@ ProcessIncomingNotify(void)
/* Notify the frontend */ /* Notify the frontend */
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "ProcessIncomingNotify: received %s from %d", elog(LOG, "ProcessIncomingNotify: received %s from %d",
relname, (int) sourcePID); relname, (int) sourcePID);
NotifyMyFrontEnd(relname, sourcePID); NotifyMyFrontEnd(relname, sourcePID);
...@@ -834,7 +834,7 @@ ProcessIncomingNotify(void) ...@@ -834,7 +834,7 @@ ProcessIncomingNotify(void)
set_ps_display("idle"); set_ps_display("idle");
if (Trace_notify) if (Trace_notify)
elog(DEBUG, "ProcessIncomingNotify: done"); elog(LOG, "ProcessIncomingNotify: done");
} }
/* /*
...@@ -861,7 +861,7 @@ NotifyMyFrontEnd(char *relname, int32 listenerPID) ...@@ -861,7 +861,7 @@ NotifyMyFrontEnd(char *relname, int32 listenerPID)
*/ */
} }
else else
elog(NOTICE, "NOTIFY for %s", relname); elog(INFO, "NOTIFY for %s", relname);
} }
/* Does pendingNotifies include the given relname? */ /* Does pendingNotifies include the given relname? */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* The PerformAddAttribute() code, like most of the relation * The PerformAddAttribute() code, like most of the relation
...@@ -1501,8 +1501,7 @@ AlterTableDropConstraint(const char *relationName, ...@@ -1501,8 +1501,7 @@ AlterTableDropConstraint(const char *relationName,
constrName); constrName);
/* Otherwise if more than one constraint deleted, notify */ /* Otherwise if more than one constraint deleted, notify */
else if (deleted > 1) else if (deleted > 1)
elog(NOTICE, "Multiple constraints dropped"); elog(INFO, "Multiple constraints dropped");
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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, ...@@ -425,7 +425,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
* Yes, try to merge the two column definitions. They must * Yes, try to merge the two column definitions. They must
* have the same type and typmod. * 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); attributeName);
def = (ColumnDef *) nth(exist_attno - 1, inhSchema); def = (ColumnDef *) nth(exist_attno - 1, inhSchema);
if (strcmp(def->typename->name, attributeType) != 0 || if (strcmp(def->typename->name, attributeType) != 0 ||
...@@ -564,7 +564,7 @@ MergeAttributes(List *schema, List *supers, bool istemp, ...@@ -564,7 +564,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
* Yes, try to merge the two column definitions. They must * Yes, try to merge the two column definitions. They must
* have the same type and typmod. * 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); attributeName);
def = (ColumnDef *) nth(exist_attno - 1, inhSchema); def = (ColumnDef *) nth(exist_attno - 1, inhSchema);
if (strcmp(def->typename->name, attributeType) != 0 || if (strcmp(def->typename->name, attributeType) != 0 ||
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * 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 * DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the * The "DefineFoo" routines take the parse tree and pick out the
...@@ -348,12 +348,12 @@ DefineOperator(char *oprName, ...@@ -348,12 +348,12 @@ DefineOperator(char *oprName,
else if (strcasecmp(defel->defname, "precedence") == 0) else if (strcasecmp(defel->defname, "precedence") == 0)
{ {
/* NOT IMPLEMENTED (never worked in v4.2) */ /* 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) else if (strcasecmp(defel->defname, "associativity") == 0)
{ {
/* NOT IMPLEMENTED (never worked in v4.2) */ /* 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) else if (strcasecmp(defel->defname, "commutator") == 0)
commutatorName = defGetString(defel); commutatorName = defGetString(defel);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994-5, Regents of the University of California * 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) ...@@ -59,7 +59,7 @@ ExplainQuery(Query *query, bool verbose, bool analyze, CommandDest dest)
/* rewriter will not cope with utility statements */ /* rewriter will not cope with utility statements */
if (query->commandType == CMD_UTILITY) if (query->commandType == CMD_UTILITY)
{ {
elog(NOTICE, "Utility statements have no plan structure"); elog(INFO, "Utility statements have no plan structure");
return; return;
} }
...@@ -69,7 +69,7 @@ ExplainQuery(Query *query, bool verbose, bool analyze, CommandDest dest) ...@@ -69,7 +69,7 @@ ExplainQuery(Query *query, bool verbose, bool analyze, CommandDest dest)
/* In the case of an INSTEAD NOTHING, tell at least that */ /* In the case of an INSTEAD NOTHING, tell at least that */
if (rewritten == NIL) if (rewritten == NIL)
{ {
elog(NOTICE, "Query rewrites to nothing"); elog(INFO, "Query rewrites to nothing");
return; return;
} }
...@@ -94,9 +94,9 @@ ExplainOneQuery(Query *query, bool verbose, bool analyze, CommandDest dest) ...@@ -94,9 +94,9 @@ ExplainOneQuery(Query *query, bool verbose, bool analyze, CommandDest dest)
if (query->commandType == CMD_UTILITY) if (query->commandType == CMD_UTILITY)
{ {
if (query->utilityStmt && IsA(query->utilityStmt, NotifyStmt)) if (query->utilityStmt && IsA(query->utilityStmt, NotifyStmt))
elog(NOTICE, "QUERY PLAN:\n\nNOTIFY\n"); elog(INFO, "QUERY PLAN:\n\nNOTIFY\n");
else else
elog(NOTICE, "QUERY PLAN:\n\nUTILITY\n"); elog(INFO, "QUERY PLAN:\n\nUTILITY\n");
return; return;
} }
...@@ -152,7 +152,7 @@ ExplainOneQuery(Query *query, bool verbose, bool analyze, CommandDest dest) ...@@ -152,7 +152,7 @@ ExplainOneQuery(Query *query, bool verbose, bool analyze, CommandDest dest)
s = nodeToString(plan); s = nodeToString(plan);
if (s) if (s)
{ {
elog(NOTICE, "QUERY DUMP:\n\n%s", s); elog(INFO, "QUERY DUMP:\n\n%s", s);
pfree(s); pfree(s);
} }
} }
...@@ -165,7 +165,7 @@ ExplainOneQuery(Query *query, bool verbose, bool analyze, CommandDest dest) ...@@ -165,7 +165,7 @@ ExplainOneQuery(Query *query, bool verbose, bool analyze, CommandDest dest)
if (analyze) if (analyze)
appendStringInfo(str, "Total runtime: %.2f msec\n", appendStringInfo(str, "Total runtime: %.2f msec\n",
1000.0 * totaltime); 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->data);
pfree(str); pfree(str);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -879,7 +879,7 @@ seq_redo(XLogRecPtr lsn, XLogRecord *record)
sequence_magic *sm; sequence_magic *sm;
if (info != XLOG_SEQ_LOG) 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); reln = XLogOpenRelation(true, RM_SEQ_ID, xlrec->node);
if (!RelationIsValid(reln)) if (!RelationIsValid(reln))
...@@ -887,7 +887,7 @@ seq_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -887,7 +887,7 @@ seq_redo(XLogRecPtr lsn, XLogRecord *record)
buffer = XLogReadBuffer(true, reln, 0); buffer = XLogReadBuffer(true, reln, 0);
if (!BufferIsValid(buffer)) 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); xlrec->node.tblNode, xlrec->node.relNode);
page = (Page) BufferGetPage(buffer); page = (Page) BufferGetPage(buffer);
...@@ -903,7 +903,7 @@ seq_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -903,7 +903,7 @@ seq_redo(XLogRecPtr lsn, XLogRecord *record)
itemsz = MAXALIGN(itemsz); itemsz = MAXALIGN(itemsz);
if (PageAddItem(page, (Item) item, itemsz, if (PageAddItem(page, (Item) item, itemsz,
FirstOffsetNumber, LP_USED) == InvalidOffsetNumber) 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); PageSetLSN(page, lsn);
PageSetSUI(page, ThisStartUpID); PageSetSUI(page, ThisStartUpID);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * 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) ...@@ -368,7 +368,7 @@ DropTrigger(DropTrigStmt *stmt)
elog(ERROR, "DropTrigger: there is no trigger %s on relation %s", elog(ERROR, "DropTrigger: there is no trigger %s on relation %s",
stmt->trigname, stmt->relname); stmt->trigname, stmt->relname);
if (tgfound > 1) 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); tgfound, stmt->trigname, stmt->relname);
/* /*
...@@ -489,7 +489,7 @@ RelationRemoveTriggers(Relation rel) ...@@ -489,7 +489,7 @@ RelationRemoveTriggers(Relation rel)
stmt.relname = pstrdup(RelationGetRelationName(refrel)); stmt.relname = pstrdup(RelationGetRelationName(refrel));
heap_close(refrel, NoLock); 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); DropTrigger(&stmt);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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) ...@@ -547,7 +547,7 @@ AlterUser(AlterUserStmt *stmt)
/* changes to the flat password file cannot be rolled back */ /* changes to the flat password file cannot be rolled back */
if (IsTransactionBlock() && password) 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 * Scan the pg_shadow relation to be certain the user exists. Note we
...@@ -785,7 +785,7 @@ DropUser(DropUserStmt *stmt) ...@@ -785,7 +785,7 @@ DropUser(DropUserStmt *stmt)
elog(ERROR, "DROP USER: permission denied"); elog(ERROR, "DROP USER: permission denied");
if (IsTransactionBlock()) 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 * Scan the pg_shadow relation to find the usesysid of the user to be
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* *
* *
* IDENTIFICATION * 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 ...@@ -108,7 +108,7 @@ typedef struct VRelStats
static MemoryContext vac_context = NULL; static MemoryContext vac_context = NULL;
static int MESSAGE_LEVEL; /* message level */ static int elevel = -1;
static TransactionId OldestXmin; static TransactionId OldestXmin;
static TransactionId FreezeLimit; static TransactionId FreezeLimit;
...@@ -192,10 +192,10 @@ vacuum(VacuumStmt *vacstmt) ...@@ -192,10 +192,10 @@ vacuum(VacuumStmt *vacstmt)
pgstat_vacuum_tabstat(); pgstat_vacuum_tabstat();
if (vacstmt->verbose) if (vacstmt->verbose)
MESSAGE_LEVEL = NOTICE; elevel = INFO;
else else
MESSAGE_LEVEL = DEBUG; elevel = DEBUG1;
/* /*
* Create special memory context for cross-transaction storage. * Create special memory context for cross-transaction storage.
* *
...@@ -964,7 +964,7 @@ scan_heap(VRelStats *vacrelstats, Relation onerel, ...@@ -964,7 +964,7 @@ scan_heap(VRelStats *vacrelstats, Relation onerel,
vac_init_rusage(&ru0); vac_init_rusage(&ru0);
relname = RelationGetRelationName(onerel); relname = RelationGetRelationName(onerel);
elog(MESSAGE_LEVEL, "--Relation %s--", relname); elog(elevel, "--Relation %s--", relname);
empty_pages = new_pages = changed_pages = empty_end_pages = 0; empty_pages = new_pages = changed_pages = empty_end_pages = 0;
num_tuples = tups_vacuumed = nkeep = nunused = 0; num_tuples = tups_vacuumed = nkeep = nunused = 0;
...@@ -1275,7 +1275,7 @@ scan_heap(VRelStats *vacrelstats, Relation onerel, ...@@ -1275,7 +1275,7 @@ scan_heap(VRelStats *vacrelstats, Relation onerel,
pfree(vtlinks); 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; \ 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", Re-using: Free/Avail. Space %.0f/%.0f; EndEmpty/Avail. Pages %u/%u.\n\t%s",
nblocks, changed_pages, vacuum_pages->num_pages, empty_pages, nblocks, changed_pages, vacuum_pages->num_pages, empty_pages,
...@@ -1849,7 +1849,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, ...@@ -1849,7 +1849,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
InvalidOffsetNumber, LP_USED); InvalidOffsetNumber, LP_USED);
if (newoff == InvalidOffsetNumber) 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); (unsigned long) tuple_len, destvacpage->blkno);
} }
newitemid = PageGetItemId(ToPage, newoff); newitemid = PageGetItemId(ToPage, newoff);
...@@ -1972,7 +1972,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, ...@@ -1972,7 +1972,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
InvalidOffsetNumber, LP_USED); InvalidOffsetNumber, LP_USED);
if (newoff == InvalidOffsetNumber) 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, (unsigned long) tuple_len,
cur_page->blkno, (unsigned long) cur_page->free, cur_page->blkno, (unsigned long) cur_page->free,
cur_page->offsets_used, cur_page->offsets_free); cur_page->offsets_used, cur_page->offsets_free);
...@@ -2197,7 +2197,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, ...@@ -2197,7 +2197,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
} }
Assert(num_moved == checked_moved); 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), RelationGetRelationName(onerel),
nblocks, blkno, num_moved, nblocks, blkno, num_moved,
vac_show_rusage(&ru0)); vac_show_rusage(&ru0));
...@@ -2369,7 +2369,7 @@ vacuum_heap(VRelStats *vacrelstats, Relation onerel, VacPageList vacuum_pages) ...@@ -2369,7 +2369,7 @@ vacuum_heap(VRelStats *vacrelstats, Relation onerel, VacPageList vacuum_pages)
/* truncate relation if there are some empty end-pages */ /* truncate relation if there are some empty end-pages */
if (vacuum_pages->empty_end_pages > 0) if (vacuum_pages->empty_end_pages > 0)
{ {
elog(MESSAGE_LEVEL, "Rel %s: Pages: %u --> %u.", elog(elevel, "Rel %s: Pages: %u --> %u.",
RelationGetRelationName(onerel), RelationGetRelationName(onerel),
vacrelstats->rel_pages, relblocks); vacrelstats->rel_pages, relblocks);
relblocks = smgrtruncate(DEFAULT_SMGR, onerel, relblocks); relblocks = smgrtruncate(DEFAULT_SMGR, onerel, relblocks);
...@@ -2443,7 +2443,7 @@ scan_index(Relation indrel, double num_tuples) ...@@ -2443,7 +2443,7 @@ scan_index(Relation indrel, double num_tuples)
stats->num_pages, stats->num_index_tuples, stats->num_pages, stats->num_index_tuples,
false); 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), RelationGetRelationName(indrel),
stats->num_pages, stats->num_index_tuples, stats->num_pages, stats->num_index_tuples,
vac_show_rusage(&ru0)); vac_show_rusage(&ru0));
...@@ -2497,7 +2497,7 @@ vacuum_index(VacPageList vacpagelist, Relation indrel, ...@@ -2497,7 +2497,7 @@ vacuum_index(VacPageList vacpagelist, Relation indrel,
stats->num_pages, stats->num_index_tuples, stats->num_pages, stats->num_index_tuples,
false); 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, RelationGetRelationName(indrel), stats->num_pages,
stats->num_index_tuples - keep_tuples, stats->tuples_removed, stats->num_index_tuples - keep_tuples, stats->tuples_removed,
vac_show_rusage(&ru0)); vac_show_rusage(&ru0));
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* *
* *
* IDENTIFICATION * 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 ...@@ -92,7 +92,7 @@ typedef struct LVRelStats
} LVRelStats; } LVRelStats;
static int MESSAGE_LEVEL; /* message level */ static int elevel = -1;
static TransactionId OldestXmin; static TransactionId OldestXmin;
static TransactionId FreezeLimit; static TransactionId FreezeLimit;
...@@ -138,12 +138,11 @@ lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt) ...@@ -138,12 +138,11 @@ lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt)
bool hasindex; bool hasindex;
BlockNumber possibly_freeable; BlockNumber possibly_freeable;
/* initialize */
if (vacstmt->verbose) if (vacstmt->verbose)
MESSAGE_LEVEL = NOTICE; elevel = INFO;
else else
MESSAGE_LEVEL = DEBUG; elevel = DEBUG1;
vacuum_set_xid_limits(vacstmt, onerel->rd_rel->relisshared, vacuum_set_xid_limits(vacstmt, onerel->rd_rel->relisshared,
&OldestXmin, &FreezeLimit); &OldestXmin, &FreezeLimit);
...@@ -208,7 +207,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats, ...@@ -208,7 +207,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
vac_init_rusage(&ru0); vac_init_rusage(&ru0);
relname = RelationGetRelationName(onerel); relname = RelationGetRelationName(onerel);
elog(MESSAGE_LEVEL, "--Relation %s--", relname); elog(elevel, "--Relation %s--", relname);
empty_pages = changed_pages = 0; empty_pages = changed_pages = 0;
num_tuples = tups_vacuumed = nkeep = nunused = 0; num_tuples = tups_vacuumed = nkeep = nunused = 0;
...@@ -430,7 +429,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats, ...@@ -430,7 +429,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
lazy_scan_index(Irel[i], 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", Tup %.0f: Vac %.0f, Keep %.0f, UnUsed %.0f.\n\tTotal %s",
nblocks, changed_pages, empty_pages, nblocks, changed_pages, empty_pages,
num_tuples, tups_vacuumed, nkeep, nunused, num_tuples, tups_vacuumed, nkeep, nunused,
...@@ -481,8 +480,7 @@ lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats) ...@@ -481,8 +480,7 @@ lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats)
npages++; npages++;
} }
elog(MESSAGE_LEVEL, "Removed %d tuples in %d pages.\n\t%s", elog(elevel, "Removed %d tuples in %d pages.\n\t%s", tupindex, npages,
tupindex, npages,
vac_show_rusage(&ru0)); vac_show_rusage(&ru0));
} }
...@@ -589,7 +587,7 @@ lazy_scan_index(Relation indrel, LVRelStats *vacrelstats) ...@@ -589,7 +587,7 @@ lazy_scan_index(Relation indrel, LVRelStats *vacrelstats)
stats->num_pages, stats->num_index_tuples, stats->num_pages, stats->num_index_tuples,
false); 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), RelationGetRelationName(indrel),
stats->num_pages, stats->num_index_tuples, stats->num_pages, stats->num_index_tuples,
vac_show_rusage(&ru0)); vac_show_rusage(&ru0));
...@@ -636,7 +634,7 @@ lazy_vacuum_index(Relation indrel, LVRelStats *vacrelstats) ...@@ -636,7 +634,7 @@ lazy_vacuum_index(Relation indrel, LVRelStats *vacrelstats)
stats->num_pages, stats->num_index_tuples, stats->num_pages, stats->num_index_tuples,
false); 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, RelationGetRelationName(indrel), stats->num_pages,
stats->num_index_tuples, stats->tuples_removed, stats->num_index_tuples, stats->tuples_removed,
vac_show_rusage(&ru0)); vac_show_rusage(&ru0));
...@@ -746,9 +744,8 @@ lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats) ...@@ -746,9 +744,8 @@ lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats)
* We keep the exclusive lock until commit (perhaps not necessary)? * We keep the exclusive lock until commit (perhaps not necessary)?
*/ */
elog(MESSAGE_LEVEL, "Truncated %u --> %u pages.\n\t%s", elog(elevel, "Truncated %u --> %u pages.\n\t%s", old_rel_pages,
old_rel_pages, new_rel_pages, new_rel_pages, vac_show_rusage(&ru0));
vac_show_rusage(&ru0));
} }
/* /*
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -295,7 +295,7 @@ show_datestyle(void)
strcat(buf, ((EuroDates) ? "European" : "US (NonEuropean)")); strcat(buf, ((EuroDates) ? "European" : "US (NonEuropean)"));
strcat(buf, " conventions"); strcat(buf, " conventions");
elog(NOTICE, buf, NULL); elog(INFO, buf, NULL);
return TRUE; return TRUE;
} }
...@@ -482,9 +482,9 @@ show_timezone(void) ...@@ -482,9 +482,9 @@ show_timezone(void)
tzn = getenv("TZ"); tzn = getenv("TZ");
if (tzn != NULL) if (tzn != NULL)
elog(NOTICE, "Time zone is '%s'", tzn); elog(INFO, "Time zone is '%s'", tzn);
else else
elog(NOTICE, "Time zone is unset"); elog(INFO, "Time zone is unset");
return TRUE; return TRUE;
} /* show_timezone() */ } /* show_timezone() */
...@@ -576,9 +576,9 @@ show_XactIsoLevel(void) ...@@ -576,9 +576,9 @@ show_XactIsoLevel(void)
{ {
if (XactIsoLevel == XACT_SERIALIZABLE) if (XactIsoLevel == XACT_SERIALIZABLE)
elog(NOTICE, "TRANSACTION ISOLATION LEVEL is SERIALIZABLE"); elog(INFO, "TRANSACTION ISOLATION LEVEL is SERIALIZABLE");
else else
elog(NOTICE, "TRANSACTION ISOLATION LEVEL is READ COMMITTED"); elog(INFO, "TRANSACTION ISOLATION LEVEL is READ COMMITTED");
return TRUE; return TRUE;
} }
...@@ -623,7 +623,7 @@ parse_random_seed(List *args) ...@@ -623,7 +623,7 @@ parse_random_seed(List *args)
static bool static bool
show_random_seed(void) show_random_seed(void)
{ {
elog(NOTICE, "Seed for random number generator is unavailable"); elog(INFO, "Seed for random number generator is unavailable");
return (TRUE); return (TRUE);
} }
...@@ -690,7 +690,7 @@ parse_client_encoding(List *args) ...@@ -690,7 +690,7 @@ parse_client_encoding(List *args)
static bool static bool
show_client_encoding(void) show_client_encoding(void)
{ {
elog(NOTICE, "Current client encoding is '%s'", elog(INFO, "Current client encoding is '%s'",
pg_get_client_encoding_name()); pg_get_client_encoding_name());
return TRUE; return TRUE;
} }
...@@ -727,21 +727,21 @@ set_default_client_encoding(void) ...@@ -727,21 +727,21 @@ set_default_client_encoding(void)
static bool static bool
parse_server_encoding(List *args) parse_server_encoding(List *args)
{ {
elog(NOTICE, "SET SERVER_ENCODING is not supported"); elog(INFO, "SET SERVER_ENCODING is not supported");
return TRUE; return TRUE;
} }
static bool static bool
show_server_encoding(void) show_server_encoding(void)
{ {
elog(NOTICE, "Current server encoding is '%s'", GetDatabaseEncodingName()); elog(INFO, "Current server encoding is '%s'", GetDatabaseEncodingName());
return TRUE; return TRUE;
} }
static bool static bool
reset_server_encoding(void) reset_server_encoding(void)
{ {
elog(NOTICE, "RESET SERVER_ENCODING is not supported"); elog(INFO, "RESET SERVER_ENCODING is not supported");
return TRUE; return TRUE;
} }
...@@ -814,7 +814,7 @@ GetPGVariable(const char *name) ...@@ -814,7 +814,7 @@ GetPGVariable(const char *name)
{ {
const char *val = GetConfigOption(name); const char *val = GetConfigOption(name);
elog(NOTICE, "%s is %s", name, val); elog(INFO, "%s is %s", name, val);
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: execAmi.c,v 1.61 2002/02/19 20:11:13 tgl Exp $ * $Id: execAmi.c,v 1.62 2002/03/02 21:39:24 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -201,7 +201,7 @@ ExecMarkPos(Plan *node) ...@@ -201,7 +201,7 @@ ExecMarkPos(Plan *node)
default: default:
/* don't make hard error unless caller asks to restore... */ /* don't make hard error unless caller asks to restore... */
elog(DEBUG, "ExecMarkPos: node type %d not supported", elog(LOG, "ExecMarkPos: node type %d not supported",
nodeTag(node)); nodeTag(node));
break; break;
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.150 2002/02/27 19:34:48 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.151 2002/03/02 21:39:25 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1095,7 +1095,7 @@ lnext: ; ...@@ -1095,7 +1095,7 @@ lnext: ;
break; break;
default: default:
elog(DEBUG, "ExecutePlan: unknown operation in queryDesc"); elog(LOG, "ExecutePlan: unknown operation in queryDesc");
result = NULL; result = NULL;
break; break;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Copyright (c) 2001, PostgreSQL Global Development Group * Copyright (c) 2001, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/instrument.c,v 1.2 2001/10/25 05:49:28 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/instrument.c,v 1.3 2002/03/02 21:39:25 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -37,7 +37,7 @@ InstrStartNode(Instrumentation *instr) ...@@ -37,7 +37,7 @@ InstrStartNode(Instrumentation *instr)
return; return;
if (instr->starttime.tv_sec != 0 || instr->starttime.tv_usec != 0) if (instr->starttime.tv_sec != 0 || instr->starttime.tv_usec != 0)
elog(DEBUG, "InstrStartTimer called twice in a row"); elog(LOG, "InstrStartTimer called twice in a row");
else else
gettimeofday(&instr->starttime, NULL); gettimeofday(&instr->starttime, NULL);
} }
...@@ -53,7 +53,7 @@ InstrStopNode(Instrumentation *instr, bool returnedTuple) ...@@ -53,7 +53,7 @@ InstrStopNode(Instrumentation *instr, bool returnedTuple)
if (instr->starttime.tv_sec == 0 && instr->starttime.tv_usec == 0) if (instr->starttime.tv_sec == 0 && instr->starttime.tv_usec == 0)
{ {
elog(DEBUG, "InstrStopNode without start"); elog(LOG, "InstrStopNode without start");
return; return;
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.78 2001/10/25 05:49:28 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.79 2002/03/02 21:39:25 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -757,7 +757,7 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent) ...@@ -757,7 +757,7 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent)
* So, just make a debug note, and force numaggs positive so that * So, just make a debug note, and force numaggs positive so that
* palloc()s below don't choke. * palloc()s below don't choke.
*/ */
elog(DEBUG, "ExecInitAgg: could not find any aggregate functions"); elog(LOG, "ExecInitAgg: could not find any aggregate functions");
numaggs = 1; numaggs = 1;
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.43 2001/10/25 05:49:28 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.44 2002/03/02 21:39:25 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -290,7 +290,7 @@ ExecProcAppend(Append *node) ...@@ -290,7 +290,7 @@ ExecProcAppend(Append *node)
subnode = (Plan *) nth(whichplan, appendplans); subnode = (Plan *) nth(whichplan, appendplans);
if (subnode == NULL) if (subnode == NULL)
elog(DEBUG, "ExecProcAppend: subnode is NULL"); elog(LOG, "ExecProcAppend: subnode is NULL");
/* /*
* get a tuple from the subplan * get a tuple from the subplan
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.75 2002/02/25 20:07:02 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.76 2002/03/02 21:39:25 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -691,9 +691,7 @@ pam_passwd_conv_proc(int num_msg, const struct pam_message ** msg, struct pam_re ...@@ -691,9 +691,7 @@ pam_passwd_conv_proc(int num_msg, const struct pam_message ** msg, struct pam_re
initStringInfo(&buf); initStringInfo(&buf);
pq_getstr(&buf); pq_getstr(&buf);
if (DebugLvl > 5) elog(DEBUG5, "received PAM packet with len=%d, pw=%s\n", len, buf.data);
fprintf(stderr, "received PAM packet with len=%d, pw=%s\n",
len, buf.data);
if (strlen(buf.data) == 0) if (strlen(buf.data) == 0)
{ {
...@@ -856,9 +854,8 @@ recv_and_check_password_packet(Port *port) ...@@ -856,9 +854,8 @@ recv_and_check_password_packet(Port *port)
return STATUS_EOF; return STATUS_EOF;
} }
if (DebugLvl > 5) /* this is probably a BAD idea... */ elog(DEBUG5, "received password packet with len=%d, pw=%s\n",
fprintf(stderr, "received password packet with len=%d, pw=%s\n", len, buf.data);
len, buf.data);
result = checkPassword(port, port->user, buf.data); result = checkPassword(port, port->user, buf.data);
pfree(buf.data); pfree(buf.data);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Header: /cvsroot/pgsql/src/backend/libpq/crypt.c,v 1.42 2001/11/05 17:46:25 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/crypt.c,v 1.43 2002/03/02 21:39:26 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -65,7 +65,7 @@ crypt_openpwdfile(void) ...@@ -65,7 +65,7 @@ crypt_openpwdfile(void)
pwdfile = AllocateFile(filename, "r"); pwdfile = AllocateFile(filename, "r");
if (pwdfile == NULL && errno != ENOENT) if (pwdfile == NULL && errno != ENOENT)
elog(DEBUG, "could not open %s: %m", filename); elog(LOG, "could not open %s: %m", filename);
pfree(filename); pfree(filename);
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pqcomm.c,v 1.126 2001/12/04 20:57:22 tgl Exp $ * $Id: pqcomm.c,v 1.127 2002/03/02 21:39:26 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -507,15 +507,15 @@ pq_recvbuf(void) ...@@ -507,15 +507,15 @@ pq_recvbuf(void)
* Careful: an elog() that tries to write to the client * Careful: an elog() that tries to write to the client
* would cause recursion to here, leading to stack overflow * would cause recursion to here, leading to stack overflow
* and core dump! This message must go *only* to the postmaster * and core dump! This message must go *only* to the postmaster
* log. elog(DEBUG) is presently safe. * log. elog(LOG) is presently safe.
*/ */
elog(DEBUG, "pq_recvbuf: recv() failed: %m"); elog(LOG, "pq_recvbuf: recv() failed: %m");
return EOF; return EOF;
} }
if (r == 0) if (r == 0)
{ {
/* as above, only write to postmaster log */ /* as above, only write to postmaster log */
elog(DEBUG, "pq_recvbuf: unexpected EOF on client connection"); elog(LOG, "pq_recvbuf: unexpected EOF on client connection");
return EOF; return EOF;
} }
/* r contains number of bytes read, so just incr length */ /* r contains number of bytes read, so just incr length */
...@@ -680,7 +680,7 @@ pq_flush(void) ...@@ -680,7 +680,7 @@ pq_flush(void)
* Careful: an elog() that tries to write to the client * Careful: an elog() that tries to write to the client
* would cause recursion to here, leading to stack overflow * would cause recursion to here, leading to stack overflow
* and core dump! This message must go *only* to the postmaster * and core dump! This message must go *only* to the postmaster
* log. elog(DEBUG) is presently safe. * log. elog(LOG) is presently safe.
* *
* If a client disconnects while we're in the midst of output, * If a client disconnects while we're in the midst of output,
* we might write quite a bit of data before we get to a safe * we might write quite a bit of data before we get to a safe
...@@ -689,7 +689,7 @@ pq_flush(void) ...@@ -689,7 +689,7 @@ pq_flush(void)
if (errno != last_reported_send_errno) if (errno != last_reported_send_errno)
{ {
last_reported_send_errno = errno; last_reported_send_errno = errno;
elog(DEBUG, "pq_flush: send() failed: %m"); elog(LOG, "pq_flush: send() failed: %m");
} }
/* /*
...@@ -723,7 +723,7 @@ pq_eof(void) ...@@ -723,7 +723,7 @@ pq_eof(void)
if (res < 0) if (res < 0)
{ {
/* can log to postmaster log only */ /* can log to postmaster log only */
elog(DEBUG, "pq_eof: recv() failed: %m"); elog(LOG, "pq_eof: recv() failed: %m");
return EOF; return EOF;
} }
if (res == 0) if (res == 0)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* geqo_erx.c * geqo_erx.c
* edge recombination crossover [ER] * edge recombination crossover [ER]
* *
* $Id: geqo_erx.c,v 1.16 2001/10/25 05:49:31 momjian Exp $ * $Id: geqo_erx.c,v 1.17 2002/03/02 21:39:26 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -419,7 +419,7 @@ edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene) ...@@ -419,7 +419,7 @@ edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene)
} }
} }
elog(DEBUG, "edge_failure(1): no edge found via random decision and total_edges == 4"); elog(LOG, "edge_failure(1): no edge found via random decision and total_edges == 4");
} }
else else
...@@ -444,7 +444,7 @@ edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene) ...@@ -444,7 +444,7 @@ edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene)
} }
} }
elog(DEBUG, "edge_failure(2): no edge found via random decision and remainig edges"); elog(LOG, "edge_failure(2): no edge found via random decision and remainig edges");
} }
/* /*
...@@ -462,7 +462,7 @@ edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene) ...@@ -462,7 +462,7 @@ edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene)
if (edge_table[i].unused_edges >= 0) if (edge_table[i].unused_edges >= 0)
return (Gene) i; return (Gene) i;
elog(DEBUG, "edge_failure(3): no edge found via looking for the last ununsed point"); elog(LOG, "edge_failure(3): no edge found via looking for the last ununsed point");
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: geqo_main.c,v 1.29 2001/10/25 05:49:31 momjian Exp $ * $Id: geqo_main.c,v 1.30 2002/03/02 21:39:26 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -120,30 +120,30 @@ geqo(Query *root, int number_of_rels, List *initial_rels) ...@@ -120,30 +120,30 @@ geqo(Query *root, int number_of_rels, List *initial_rels)
daddy = alloc_chromo(pool->string_length); daddy = alloc_chromo(pool->string_length);
#if defined (ERX) #if defined (ERX)
elog(DEBUG, "geqo_main: using edge recombination crossover [ERX]"); elog(LOG, "geqo_main: using edge recombination crossover [ERX]");
/* allocate edge table memory */ /* allocate edge table memory */
edge_table = alloc_edge_table(pool->string_length); edge_table = alloc_edge_table(pool->string_length);
#elif defined(PMX) #elif defined(PMX)
elog(DEBUG, "geqo_main: using partially matched crossover [PMX]"); elog(LOG, "geqo_main: using partially matched crossover [PMX]");
/* allocate chromosome kid memory */ /* allocate chromosome kid memory */
kid = alloc_chromo(pool->string_length); kid = alloc_chromo(pool->string_length);
#elif defined(CX) #elif defined(CX)
elog(DEBUG, "geqo_main: using cycle crossover [CX]"); elog(LOG, "geqo_main: using cycle crossover [CX]");
/* allocate city table memory */ /* allocate city table memory */
kid = alloc_chromo(pool->string_length); kid = alloc_chromo(pool->string_length);
city_table = alloc_city_table(pool->string_length); city_table = alloc_city_table(pool->string_length);
#elif defined(PX) #elif defined(PX)
elog(DEBUG, "geqo_main: using position crossover [PX]"); elog(LOG, "geqo_main: using position crossover [PX]");
/* allocate city table memory */ /* allocate city table memory */
kid = alloc_chromo(pool->string_length); kid = alloc_chromo(pool->string_length);
city_table = alloc_city_table(pool->string_length); city_table = alloc_city_table(pool->string_length);
#elif defined(OX1) #elif defined(OX1)
elog(DEBUG, "geqo_main: using order crossover [OX1]"); elog(LOG, "geqo_main: using order crossover [OX1]");
/* allocate city table memory */ /* allocate city table memory */
kid = alloc_chromo(pool->string_length); kid = alloc_chromo(pool->string_length);
city_table = alloc_city_table(pool->string_length); city_table = alloc_city_table(pool->string_length);
#elif defined(OX2) #elif defined(OX2)
elog(DEBUG, "geqo_main: using order crossover [OX2]"); elog(LOG, "geqo_main: using order crossover [OX2]");
/* allocate city table memory */ /* allocate city table memory */
kid = alloc_chromo(pool->string_length); kid = alloc_chromo(pool->string_length);
city_table = alloc_city_table(pool->string_length); city_table = alloc_city_table(pool->string_length);
...@@ -214,18 +214,18 @@ geqo(Query *root, int number_of_rels, List *initial_rels) ...@@ -214,18 +214,18 @@ geqo(Query *root, int number_of_rels, List *initial_rels)
#if defined(ERX) && defined(GEQO_DEBUG) #if defined(ERX) && defined(GEQO_DEBUG)
if (edge_failures != 0) if (edge_failures != 0)
elog(DEBUG, "[GEQO] failures: %d, average: %d", elog(LOG, "[GEQO] failures: %d, average: %d",
edge_failures, (int) generation / edge_failures); edge_failures, (int) generation / edge_failures);
else else
elog(DEBUG, "[GEQO] No edge failures detected."); elog(LOG, "[GEQO] No edge failures detected.");
#endif #endif
#if defined(CX) && defined(GEQO_DEBUG) #if defined(CX) && defined(GEQO_DEBUG)
if (mutations != 0) if (mutations != 0)
elog(DEBUG, "[GEQO] mutations: %d, generations: %d", mutations, generation); elog(LOG, "[GEQO] mutations: %d, generations: %d", mutations, generation);
else else
elog(DEBUG, "[GEQO] No mutations processed."); elog(LOG, "[GEQO] No mutations processed.");
#endif #endif
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.112 2001/10/25 05:49:32 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.113 2002/03/02 21:39:26 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1299,7 +1299,7 @@ pred_test_simple_clause(Expr *predicate, Node *clause) ...@@ -1299,7 +1299,7 @@ pred_test_simple_clause(Expr *predicate, Node *clause)
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
/* this probably shouldn't fail? */ /* this probably shouldn't fail? */
elog(DEBUG, "pred_test_simple_clause: unknown test_op"); elog(LOG, "pred_test_simple_clause: unknown test_op");
return false; return false;
} }
aform = (Form_pg_amop) GETSTRUCT(tuple); aform = (Form_pg_amop) GETSTRUCT(tuple);
...@@ -1327,7 +1327,7 @@ pred_test_simple_clause(Expr *predicate, Node *clause) ...@@ -1327,7 +1327,7 @@ pred_test_simple_clause(Expr *predicate, Node *clause)
if (isNull) if (isNull)
{ {
elog(DEBUG, "pred_test_simple_clause: null test result"); elog(LOG, "pred_test_simple_clause: null test result");
return false; return false;
} }
return DatumGetBool(test_result); return DatumGetBool(test_result);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.215 2002/02/26 22:47:08 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.216 2002/03/02 21:39:27 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -849,7 +849,7 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt, ...@@ -849,7 +849,7 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
sequence->istemp = cxt->istemp; sequence->istemp = cxt->istemp;
sequence->options = NIL; sequence->options = NIL;
elog(NOTICE, "%s will create implicit sequence '%s' for SERIAL column '%s.%s'", elog(INFO, "%s will create implicit sequence '%s' for SERIAL column '%s.%s'",
cxt->stmtType, sequence->seqname, cxt->relname, column->colname); cxt->stmtType, sequence->seqname, cxt->relname, column->colname);
cxt->blist = lappend(cxt->blist, sequence); cxt->blist = lappend(cxt->blist, sequence);
...@@ -1264,7 +1264,7 @@ transformIndexConstraints(ParseState *pstate, CreateStmtContext *cxt) ...@@ -1264,7 +1264,7 @@ transformIndexConstraints(ParseState *pstate, CreateStmtContext *cxt)
elog(ERROR, "%s: failed to make implicit index name", elog(ERROR, "%s: failed to make implicit index name",
cxt->stmtType); cxt->stmtType);
elog(NOTICE, "%s / %s%s will create implicit index '%s' for table '%s'", elog(INFO, "%s / %s%s will create implicit index '%s' for table '%s'",
cxt->stmtType, cxt->stmtType,
(strcmp(cxt->stmtType, "ALTER TABLE") == 0) ? "ADD " : "", (strcmp(cxt->stmtType, "ALTER TABLE") == 0) ? "ADD " : "",
(index->primary ? "PRIMARY KEY" : "UNIQUE"), (index->primary ? "PRIMARY KEY" : "UNIQUE"),
...@@ -1288,7 +1288,7 @@ transformFKConstraints(ParseState *pstate, CreateStmtContext *cxt) ...@@ -1288,7 +1288,7 @@ transformFKConstraints(ParseState *pstate, CreateStmtContext *cxt)
if (cxt->fkconstraints == NIL) if (cxt->fkconstraints == NIL)
return; return;
elog(NOTICE, "%s will create implicit trigger(s) for FOREIGN KEY check(s)", elog(INFO, "%s will create implicit trigger(s) for FOREIGN KEY check(s)",
cxt->stmtType); cxt->stmtType);
foreach(fkclist, cxt->fkconstraints) foreach(fkclist, cxt->fkconstraints)
...@@ -2710,7 +2710,7 @@ transformTypeRef(ParseState *pstate, TypeName *tn) ...@@ -2710,7 +2710,7 @@ transformTypeRef(ParseState *pstate, TypeName *tn)
elog(ERROR, "unsupported expression in %%TYPE"); elog(ERROR, "unsupported expression in %%TYPE");
v = (Var *) n; v = (Var *) n;
tyn = typeidTypeName(v->vartype); tyn = typeidTypeName(v->vartype);
elog(NOTICE, "%s.%s%%TYPE converted to %s", tn->name, tn->attrname, tyn); elog(INFO, "%s.%s%%TYPE converted to %s", tn->name, tn->attrname, tyn);
tn->name = tyn; tn->name = tyn;
tn->typmod = v->vartypmod; tn->typmod = v->vartypmod;
tn->attrname = NULL; tn->attrname = NULL;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.282 2002/03/01 22:45:12 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.283 2002/03/02 21:39:27 momjian Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -1338,7 +1338,7 @@ columnDef: ColId Typename ColQualList opt_collate ...@@ -1338,7 +1338,7 @@ columnDef: ColId Typename ColQualList opt_collate
n->constraints = $3; n->constraints = $3;
if ($4 != NULL) if ($4 != NULL)
elog(NOTICE,"CREATE TABLE / COLLATE %s not yet implemented" elog(INFO,"CREATE TABLE / COLLATE %s not yet implemented"
"; clause ignored", $4); "; clause ignored", $4);
$$ = (Node *)n; $$ = (Node *)n;
...@@ -2336,7 +2336,7 @@ direction: FORWARD { $$ = FORWARD; } ...@@ -2336,7 +2336,7 @@ direction: FORWARD { $$ = FORWARD; }
| RELATIVE { $$ = RELATIVE; } | RELATIVE { $$ = RELATIVE; }
| ABSOLUTE | ABSOLUTE
{ {
elog(NOTICE,"FETCH / ABSOLUTE not supported, using RELATIVE"); elog(INFO,"FETCH / ABSOLUTE not supported, using RELATIVE");
$$ = RELATIVE; $$ = RELATIVE;
} }
; ;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.60 2001/11/05 17:46:26 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.61 2002/03/02 21:39:28 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1041,7 +1041,7 @@ warnAutoRange(ParseState *pstate, char *refname) ...@@ -1041,7 +1041,7 @@ warnAutoRange(ParseState *pstate, char *refname)
} }
} }
if (foundInFromCl) if (foundInFromCl)
elog(NOTICE, "Adding missing FROM-clause entry%s for table \"%s\"", elog(INFO, "Adding missing FROM-clause entry%s for table \"%s\"",
pstate->parentParseState != NULL ? " in subquery" : "", pstate->parentParseState != NULL ? " in subquery" : "",
refname); refname);
} }
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.120 2001/11/10 23:51:14 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.121 2002/03/02 21:39:28 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -443,7 +443,7 @@ BufferAlloc(Relation reln, ...@@ -443,7 +443,7 @@ BufferAlloc(Relation reln,
*/ */
if (buf->flags & BM_JUST_DIRTIED) if (buf->flags & BM_JUST_DIRTIED)
{ {
elog(STOP, "BufferAlloc: content of block %u (%u/%u) changed while flushing", elog(PANIC, "BufferAlloc: content of block %u (%u/%u) changed while flushing",
buf->tag.blockNum, buf->tag.blockNum,
buf->tag.rnode.tblNode, buf->tag.rnode.relNode); buf->tag.rnode.tblNode, buf->tag.rnode.relNode);
} }
...@@ -804,7 +804,7 @@ BufferSync() ...@@ -804,7 +804,7 @@ BufferSync()
} }
if (status == SM_FAIL) /* disk failure ?! */ if (status == SM_FAIL) /* disk failure ?! */
elog(STOP, "BufferSync: cannot write %u for %u/%u", elog(PANIC, "BufferSync: cannot write %u for %u/%u",
bufHdr->tag.blockNum, bufHdr->tag.blockNum,
bufHdr->tag.rnode.tblNode, bufHdr->tag.rnode.relNode); bufHdr->tag.rnode.tblNode, bufHdr->tag.rnode.relNode);
...@@ -1371,7 +1371,7 @@ PrintBufferDescs() ...@@ -1371,7 +1371,7 @@ PrintBufferDescs()
LWLockAcquire(BufMgrLock, LW_EXCLUSIVE); LWLockAcquire(BufMgrLock, LW_EXCLUSIVE);
for (i = 0; i < NBuffers; ++i, ++buf) for (i = 0; i < NBuffers; ++i, ++buf)
{ {
elog(DEBUG, "[%02d] (freeNext=%d, freePrev=%d, rel=%u/%u, \ elog(LOG, "[%02d] (freeNext=%d, freePrev=%d, rel=%u/%u, \
blockNum=%u, flags=0x%x, refcount=%d %ld)", blockNum=%u, flags=0x%x, refcount=%d %ld)",
i, buf->freeNext, buf->freePrev, i, buf->freeNext, buf->freePrev,
buf->tag.rnode.tblNode, buf->tag.rnode.relNode, buf->tag.rnode.tblNode, buf->tag.rnode.relNode,
...@@ -1566,7 +1566,7 @@ FlushRelationBuffers(Relation rel, BlockNumber firstDelBlock) ...@@ -1566,7 +1566,7 @@ FlushRelationBuffers(Relation rel, BlockNumber firstDelBlock)
(char *) MAKE_PTR(bufHdr->data)); (char *) MAKE_PTR(bufHdr->data));
if (status == SM_FAIL) /* disk failure ?! */ if (status == SM_FAIL) /* disk failure ?! */
elog(STOP, "FlushRelationBuffers: cannot write %u for %u/%u", elog(PANIC, "FlushRelationBuffers: cannot write %u for %u/%u",
bufHdr->tag.blockNum, bufHdr->tag.blockNum,
bufHdr->tag.rnode.tblNode, bufHdr->tag.rnode.tblNode,
bufHdr->tag.rnode.relNode); bufHdr->tag.rnode.relNode);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.88 2002/02/10 22:56:31 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.89 2002/03/02 21:39:29 momjian Exp $
* *
* NOTES: * NOTES:
* *
...@@ -270,7 +270,7 @@ tryAgain: ...@@ -270,7 +270,7 @@ tryAgain:
{ {
int save_errno = errno; int save_errno = errno;
DO_DB(elog(DEBUG, "BasicOpenFile: not enough descs, retry, er= %d", DO_DB(elog(LOG, "BasicOpenFile: not enough descs, retry, er= %d",
errno)); errno));
errno = 0; errno = 0;
if (ReleaseLruFile()) if (ReleaseLruFile())
...@@ -304,7 +304,7 @@ pg_nofile(void) ...@@ -304,7 +304,7 @@ pg_nofile(void)
#else #else
no_files = (long) max_files_per_process; no_files = (long) max_files_per_process;
#endif #endif
elog(DEBUG, "pg_nofile: sysconf(_SC_OPEN_MAX) failed; using %ld", elog(LOG, "pg_nofile: sysconf(_SC_OPEN_MAX) failed; using %ld",
no_files); no_files);
} }
#else /* !HAVE_SYSCONF */ #else /* !HAVE_SYSCONF */
...@@ -353,7 +353,7 @@ _dump_lru(void) ...@@ -353,7 +353,7 @@ _dump_lru(void)
sprintf(buf + strlen(buf), "%d ", mru); sprintf(buf + strlen(buf), "%d ", mru);
} }
sprintf(buf + strlen(buf), "LEAST"); sprintf(buf + strlen(buf), "LEAST");
elog(DEBUG, buf); elog(LOG, buf);
} }
#endif /* FDDEBUG */ #endif /* FDDEBUG */
...@@ -364,7 +364,7 @@ Delete(File file) ...@@ -364,7 +364,7 @@ Delete(File file)
Assert(file != 0); Assert(file != 0);
DO_DB(elog(DEBUG, "Delete %d (%s)", DO_DB(elog(LOG, "Delete %d (%s)",
file, VfdCache[file].fileName)); file, VfdCache[file].fileName));
DO_DB(_dump_lru()); DO_DB(_dump_lru());
...@@ -383,7 +383,7 @@ LruDelete(File file) ...@@ -383,7 +383,7 @@ LruDelete(File file)
Assert(file != 0); Assert(file != 0);
DO_DB(elog(DEBUG, "LruDelete %d (%s)", DO_DB(elog(LOG, "LruDelete %d (%s)",
file, VfdCache[file].fileName)); file, VfdCache[file].fileName));
vfdP = &VfdCache[file]; vfdP = &VfdCache[file];
...@@ -399,14 +399,14 @@ LruDelete(File file) ...@@ -399,14 +399,14 @@ LruDelete(File file)
if (vfdP->fdstate & FD_DIRTY) if (vfdP->fdstate & FD_DIRTY)
{ {
if (pg_fsync(vfdP->fd)) if (pg_fsync(vfdP->fd))
elog(DEBUG, "LruDelete: failed to fsync %s: %m", elog(LOG, "LruDelete: failed to fsync %s: %m",
vfdP->fileName); vfdP->fileName);
vfdP->fdstate &= ~FD_DIRTY; vfdP->fdstate &= ~FD_DIRTY;
} }
/* close the file */ /* close the file */
if (close(vfdP->fd)) if (close(vfdP->fd))
elog(DEBUG, "LruDelete: failed to close %s: %m", elog(LOG, "LruDelete: failed to close %s: %m",
vfdP->fileName); vfdP->fileName);
--nfile; --nfile;
...@@ -420,7 +420,7 @@ Insert(File file) ...@@ -420,7 +420,7 @@ Insert(File file)
Assert(file != 0); Assert(file != 0);
DO_DB(elog(DEBUG, "Insert %d (%s)", DO_DB(elog(LOG, "Insert %d (%s)",
file, VfdCache[file].fileName)); file, VfdCache[file].fileName));
DO_DB(_dump_lru()); DO_DB(_dump_lru());
...@@ -441,7 +441,7 @@ LruInsert(File file) ...@@ -441,7 +441,7 @@ LruInsert(File file)
Assert(file != 0); Assert(file != 0);
DO_DB(elog(DEBUG, "LruInsert %d (%s)", DO_DB(elog(LOG, "LruInsert %d (%s)",
file, VfdCache[file].fileName)); file, VfdCache[file].fileName));
vfdP = &VfdCache[file]; vfdP = &VfdCache[file];
...@@ -463,12 +463,12 @@ LruInsert(File file) ...@@ -463,12 +463,12 @@ LruInsert(File file)
vfdP->fileMode); vfdP->fileMode);
if (vfdP->fd < 0) if (vfdP->fd < 0)
{ {
DO_DB(elog(DEBUG, "RE_OPEN FAILED: %d", errno)); DO_DB(elog(LOG, "RE_OPEN FAILED: %d", errno));
return vfdP->fd; return vfdP->fd;
} }
else else
{ {
DO_DB(elog(DEBUG, "RE_OPEN SUCCESS")); DO_DB(elog(LOG, "RE_OPEN SUCCESS"));
++nfile; ++nfile;
} }
...@@ -494,7 +494,7 @@ LruInsert(File file) ...@@ -494,7 +494,7 @@ LruInsert(File file)
static bool static bool
ReleaseLruFile(void) ReleaseLruFile(void)
{ {
DO_DB(elog(DEBUG, "ReleaseLruFile. Opened %d", nfile)); DO_DB(elog(LOG, "ReleaseLruFile. Opened %d", nfile));
if (nfile > 0) if (nfile > 0)
{ {
...@@ -515,7 +515,7 @@ AllocateVfd(void) ...@@ -515,7 +515,7 @@ AllocateVfd(void)
Index i; Index i;
File file; File file;
DO_DB(elog(DEBUG, "AllocateVfd. Size %d", SizeVfdCache)); DO_DB(elog(LOG, "AllocateVfd. Size %d", SizeVfdCache));
if (SizeVfdCache == 0) if (SizeVfdCache == 0)
{ {
...@@ -587,7 +587,7 @@ FreeVfd(File file) ...@@ -587,7 +587,7 @@ FreeVfd(File file)
{ {
Vfd *vfdP = &VfdCache[file]; Vfd *vfdP = &VfdCache[file];
DO_DB(elog(DEBUG, "FreeVfd: %d (%s)", DO_DB(elog(LOG, "FreeVfd: %d (%s)",
file, vfdP->fileName ? vfdP->fileName : "")); file, vfdP->fileName ? vfdP->fileName : ""));
if (vfdP->fileName != NULL) if (vfdP->fileName != NULL)
...@@ -637,7 +637,7 @@ FileAccess(File file) ...@@ -637,7 +637,7 @@ FileAccess(File file)
{ {
int returnValue; int returnValue;
DO_DB(elog(DEBUG, "FileAccess %d (%s)", DO_DB(elog(LOG, "FileAccess %d (%s)",
file, VfdCache[file].fileName)); file, VfdCache[file].fileName));
/* /*
...@@ -691,7 +691,7 @@ fileNameOpenFile(FileName fileName, ...@@ -691,7 +691,7 @@ fileNameOpenFile(FileName fileName,
if (fileName == NULL) if (fileName == NULL)
elog(ERROR, "fileNameOpenFile: NULL fname"); elog(ERROR, "fileNameOpenFile: NULL fname");
DO_DB(elog(DEBUG, "fileNameOpenFile: %s %x %o", DO_DB(elog(LOG, "fileNameOpenFile: %s %x %o",
fileName, fileFlags, fileMode)); fileName, fileFlags, fileMode));
file = AllocateVfd(); file = AllocateVfd();
...@@ -711,7 +711,7 @@ fileNameOpenFile(FileName fileName, ...@@ -711,7 +711,7 @@ fileNameOpenFile(FileName fileName,
return -1; return -1;
} }
++nfile; ++nfile;
DO_DB(elog(DEBUG, "fileNameOpenFile: success %d", DO_DB(elog(LOG, "fileNameOpenFile: success %d",
vfdP->fd)); vfdP->fd));
Insert(file); Insert(file);
...@@ -830,7 +830,7 @@ FileClose(File file) ...@@ -830,7 +830,7 @@ FileClose(File file)
Assert(FileIsValid(file)); Assert(FileIsValid(file));
DO_DB(elog(DEBUG, "FileClose: %d (%s)", DO_DB(elog(LOG, "FileClose: %d (%s)",
file, VfdCache[file].fileName)); file, VfdCache[file].fileName));
vfdP = &VfdCache[file]; vfdP = &VfdCache[file];
...@@ -844,14 +844,14 @@ FileClose(File file) ...@@ -844,14 +844,14 @@ FileClose(File file)
if (vfdP->fdstate & FD_DIRTY) if (vfdP->fdstate & FD_DIRTY)
{ {
if (pg_fsync(vfdP->fd)) if (pg_fsync(vfdP->fd))
elog(DEBUG, "FileClose: failed to fsync %s: %m", elog(LOG, "FileClose: failed to fsync %s: %m",
vfdP->fileName); vfdP->fileName);
vfdP->fdstate &= ~FD_DIRTY; vfdP->fdstate &= ~FD_DIRTY;
} }
/* close the file */ /* close the file */
if (close(vfdP->fd)) if (close(vfdP->fd))
elog(DEBUG, "FileClose: failed to close %s: %m", elog(LOG, "FileClose: failed to close %s: %m",
vfdP->fileName); vfdP->fileName);
--nfile; --nfile;
...@@ -866,7 +866,7 @@ FileClose(File file) ...@@ -866,7 +866,7 @@ FileClose(File file)
/* reset flag so that die() interrupt won't cause problems */ /* reset flag so that die() interrupt won't cause problems */
vfdP->fdstate &= ~FD_TEMPORARY; vfdP->fdstate &= ~FD_TEMPORARY;
if (unlink(vfdP->fileName)) if (unlink(vfdP->fileName))
elog(DEBUG, "FileClose: failed to unlink %s: %m", elog(LOG, "FileClose: failed to unlink %s: %m",
vfdP->fileName); vfdP->fileName);
} }
...@@ -884,7 +884,7 @@ FileUnlink(File file) ...@@ -884,7 +884,7 @@ FileUnlink(File file)
{ {
Assert(FileIsValid(file)); Assert(FileIsValid(file));
DO_DB(elog(DEBUG, "FileUnlink: %d (%s)", DO_DB(elog(LOG, "FileUnlink: %d (%s)",
file, VfdCache[file].fileName)); file, VfdCache[file].fileName));
/* force FileClose to delete it */ /* force FileClose to delete it */
...@@ -900,7 +900,7 @@ FileRead(File file, char *buffer, int amount) ...@@ -900,7 +900,7 @@ FileRead(File file, char *buffer, int amount)
Assert(FileIsValid(file)); Assert(FileIsValid(file));
DO_DB(elog(DEBUG, "FileRead: %d (%s) %ld %d %p", DO_DB(elog(LOG, "FileRead: %d (%s) %ld %d %p",
file, VfdCache[file].fileName, file, VfdCache[file].fileName,
VfdCache[file].seekPos, amount, buffer)); VfdCache[file].seekPos, amount, buffer));
...@@ -921,7 +921,7 @@ FileWrite(File file, char *buffer, int amount) ...@@ -921,7 +921,7 @@ FileWrite(File file, char *buffer, int amount)
Assert(FileIsValid(file)); Assert(FileIsValid(file));
DO_DB(elog(DEBUG, "FileWrite: %d (%s) %ld %d %p", DO_DB(elog(LOG, "FileWrite: %d (%s) %ld %d %p",
file, VfdCache[file].fileName, file, VfdCache[file].fileName,
VfdCache[file].seekPos, amount, buffer)); VfdCache[file].seekPos, amount, buffer));
...@@ -947,7 +947,7 @@ FileSeek(File file, long offset, int whence) ...@@ -947,7 +947,7 @@ FileSeek(File file, long offset, int whence)
{ {
Assert(FileIsValid(file)); Assert(FileIsValid(file));
DO_DB(elog(DEBUG, "FileSeek: %d (%s) %ld %ld %d", DO_DB(elog(LOG, "FileSeek: %d (%s) %ld %ld %d",
file, VfdCache[file].fileName, file, VfdCache[file].fileName,
VfdCache[file].seekPos, offset, whence)); VfdCache[file].seekPos, offset, whence));
...@@ -1005,7 +1005,7 @@ long ...@@ -1005,7 +1005,7 @@ long
FileTell(File file) FileTell(File file)
{ {
Assert(FileIsValid(file)); Assert(FileIsValid(file));
DO_DB(elog(DEBUG, "FileTell %d (%s)", DO_DB(elog(LOG, "FileTell %d (%s)",
file, VfdCache[file].fileName)); file, VfdCache[file].fileName));
return VfdCache[file].seekPos; return VfdCache[file].seekPos;
} }
...@@ -1018,7 +1018,7 @@ FileTruncate(File file, long offset) ...@@ -1018,7 +1018,7 @@ FileTruncate(File file, long offset)
Assert(FileIsValid(file)); Assert(FileIsValid(file));
DO_DB(elog(DEBUG, "FileTruncate %d (%s)", DO_DB(elog(LOG, "FileTruncate %d (%s)",
file, VfdCache[file].fileName)); file, VfdCache[file].fileName));
FileSync(file); FileSync(file);
...@@ -1117,7 +1117,7 @@ FileMarkDirty(File file) ...@@ -1117,7 +1117,7 @@ FileMarkDirty(File file)
{ {
Assert(FileIsValid(file)); Assert(FileIsValid(file));
DO_DB(elog(DEBUG, "FileMarkDirty: %d (%s)", DO_DB(elog(LOG, "FileMarkDirty: %d (%s)",
file, VfdCache[file].fileName)); file, VfdCache[file].fileName));
VfdCache[file].fdstate |= FD_DIRTY; VfdCache[file].fdstate |= FD_DIRTY;
...@@ -1147,7 +1147,7 @@ AllocateFile(char *name, char *mode) ...@@ -1147,7 +1147,7 @@ AllocateFile(char *name, char *mode)
{ {
FILE *file; FILE *file;
DO_DB(elog(DEBUG, "AllocateFile: Allocated %d", numAllocatedFiles)); DO_DB(elog(LOG, "AllocateFile: Allocated %d", numAllocatedFiles));
if (numAllocatedFiles >= MAX_ALLOCATED_FILES) if (numAllocatedFiles >= MAX_ALLOCATED_FILES)
elog(ERROR, "AllocateFile: too many private FDs demanded"); elog(ERROR, "AllocateFile: too many private FDs demanded");
...@@ -1164,7 +1164,7 @@ TryAgain: ...@@ -1164,7 +1164,7 @@ TryAgain:
{ {
int save_errno = errno; int save_errno = errno;
DO_DB(elog(DEBUG, "AllocateFile: not enough descs, retry, er= %d", DO_DB(elog(LOG, "AllocateFile: not enough descs, retry, er= %d",
errno)); errno));
errno = 0; errno = 0;
if (ReleaseLruFile()) if (ReleaseLruFile())
...@@ -1180,7 +1180,7 @@ FreeFile(FILE *file) ...@@ -1180,7 +1180,7 @@ FreeFile(FILE *file)
{ {
int i; int i;
DO_DB(elog(DEBUG, "FreeFile: Allocated %d", numAllocatedFiles)); DO_DB(elog(LOG, "FreeFile: Allocated %d", numAllocatedFiles));
/* Remove file from list of allocated files, if it's present */ /* Remove file from list of allocated files, if it's present */
for (i = numAllocatedFiles; --i >= 0;) for (i = numAllocatedFiles; --i >= 0;)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.75 2001/11/05 17:46:28 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.76 2002/03/02 21:39:29 momjian Exp $
* *
* NOTES * NOTES
* *
...@@ -131,8 +131,7 @@ proc_exit(int code) ...@@ -131,8 +131,7 @@ proc_exit(int code)
InterruptHoldoffCount = 1; InterruptHoldoffCount = 1;
CritSectionCount = 0; CritSectionCount = 0;
if (DebugLvl > 1) elog(DEBUG2, "proc_exit(%d)", code);
elog(DEBUG, "proc_exit(%d)", code);
/* do our shared memory exits first */ /* do our shared memory exits first */
shmem_exit(code); shmem_exit(code);
...@@ -150,8 +149,7 @@ proc_exit(int code) ...@@ -150,8 +149,7 @@ proc_exit(int code)
(*on_proc_exit_list[on_proc_exit_index].function) (code, (*on_proc_exit_list[on_proc_exit_index].function) (code,
on_proc_exit_list[on_proc_exit_index].arg); on_proc_exit_list[on_proc_exit_index].arg);
if (DebugLvl > 1) elog(DEBUG2, "exit(%d)", code);
elog(DEBUG, "exit(%d)", code);
exit(code); exit(code);
} }
...@@ -164,8 +162,7 @@ proc_exit(int code) ...@@ -164,8 +162,7 @@ proc_exit(int code)
void void
shmem_exit(int code) shmem_exit(int code)
{ {
if (DebugLvl > 1) elog(DEBUG2, "shmem_exit(%d)", code);
elog(DEBUG, "shmem_exit(%d)", code);
/* /*
* call all the registered callbacks. * call all the registered callbacks.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.45 2001/11/04 19:55:31 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.46 2002/03/02 21:39:29 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -65,8 +65,7 @@ CreateSharedMemoryAndSemaphores(bool makePrivate, int maxBackends) ...@@ -65,8 +65,7 @@ CreateSharedMemoryAndSemaphores(bool makePrivate, int maxBackends)
/* might as well round it off to a multiple of a typical page size */ /* might as well round it off to a multiple of a typical page size */
size += 8192 - (size % 8192); size += 8192 - (size % 8192);
if (DebugLvl > 1) elog(DEBUG2, "invoking IpcMemoryCreate(size=%d)", size);
fprintf(stderr, "invoking IpcMemoryCreate(size=%d)\n", size);
/* /*
* Create the shmem segment * Create the shmem segment
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.43 2001/10/25 05:49:42 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.44 2002/03/02 21:39:29 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -66,7 +66,7 @@ SendSharedInvalidMessage(SharedInvalidationMessage *msg) ...@@ -66,7 +66,7 @@ SendSharedInvalidMessage(SharedInvalidationMessage *msg)
insertOK = SIInsertDataEntry(shmInvalBuffer, msg); insertOK = SIInsertDataEntry(shmInvalBuffer, msg);
LWLockRelease(SInvalLock); LWLockRelease(SInvalLock);
if (!insertOK) if (!insertOK)
elog(DEBUG, "SendSharedInvalidMessage: SI buffer overflow"); elog(LOG, "SendSharedInvalidMessage: SI buffer overflow");
} }
/* /*
...@@ -108,7 +108,7 @@ ReceiveSharedInvalidMessages( ...@@ -108,7 +108,7 @@ ReceiveSharedInvalidMessages(
if (getResult < 0) if (getResult < 0)
{ {
/* got a reset message */ /* got a reset message */
elog(DEBUG, "ReceiveSharedInvalidMessages: cache state reset"); elog(LOG, "ReceiveSharedInvalidMessages: cache state reset");
resetFunction(); resetFunction();
} }
else else
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.43 2001/11/05 17:46:28 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.44 2002/03/02 21:39:29 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -119,7 +119,7 @@ SIBackendInit(SISeg *segP) ...@@ -119,7 +119,7 @@ SIBackendInit(SISeg *segP)
MyBackendId = (stateP - &segP->procState[0]) + 1; MyBackendId = (stateP - &segP->procState[0]) + 1;
#ifdef INVALIDDEBUG #ifdef INVALIDDEBUG
elog(DEBUG, "SIBackendInit: backend id %d", MyBackendId); elog(LOG, "SIBackendInit: backend id %d", MyBackendId);
#endif /* INVALIDDEBUG */ #endif /* INVALIDDEBUG */
/* mark myself active, with all extant messages already read */ /* mark myself active, with all extant messages already read */
...@@ -218,8 +218,7 @@ SIInsertDataEntry(SISeg *segP, SharedInvalidationMessage *data) ...@@ -218,8 +218,7 @@ SIInsertDataEntry(SISeg *segP, SharedInvalidationMessage *data)
if (numMsgs == (MAXNUMMESSAGES * 70 / 100) && if (numMsgs == (MAXNUMMESSAGES * 70 / 100) &&
IsUnderPostmaster) IsUnderPostmaster)
{ {
if (DebugLvl >= 1) elog(DEBUG1, "SIInsertDataEntry: table is 70%% full, signaling postmaster");
elog(DEBUG, "SIInsertDataEntry: table is 70%% full, signaling postmaster");
SendPostmasterSignal(PMSIGNAL_WAKEN_CHILDREN); SendPostmasterSignal(PMSIGNAL_WAKEN_CHILDREN);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.104 2001/11/05 17:46:28 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.105 2002/03/02 21:39:29 momjian Exp $
* *
* NOTES * NOTES
* Outside modules can create a lock table and acquire/release * Outside modules can create a lock table and acquire/release
...@@ -107,7 +107,7 @@ inline static void ...@@ -107,7 +107,7 @@ inline static void
LOCK_PRINT(const char *where, const LOCK *lock, LOCKMODE type) LOCK_PRINT(const char *where, const LOCK *lock, LOCKMODE type)
{ {
if (LOCK_DEBUG_ENABLED(lock)) if (LOCK_DEBUG_ENABLED(lock))
elog(DEBUG, elog(LOG,
"%s: lock(%lx) tbl(%d) rel(%u) db(%u) obj(%u) grantMask(%x) " "%s: lock(%lx) tbl(%d) rel(%u) db(%u) obj(%u) grantMask(%x) "
"req(%d,%d,%d,%d,%d,%d,%d)=%d " "req(%d,%d,%d,%d,%d,%d,%d)=%d "
"grant(%d,%d,%d,%d,%d,%d,%d)=%d wait(%d) type(%s)", "grant(%d,%d,%d,%d,%d,%d,%d)=%d wait(%d) type(%s)",
...@@ -133,7 +133,7 @@ HOLDER_PRINT(const char *where, const HOLDER *holderP) ...@@ -133,7 +133,7 @@ HOLDER_PRINT(const char *where, const HOLDER *holderP)
&& (((LOCK *) MAKE_PTR(holderP->tag.lock))->tag.relId >= (Oid) Trace_lock_oidmin)) && (((LOCK *) MAKE_PTR(holderP->tag.lock))->tag.relId >= (Oid) Trace_lock_oidmin))
|| (Trace_lock_table && (((LOCK *) MAKE_PTR(holderP->tag.lock))->tag.relId == Trace_lock_table)) || (Trace_lock_table && (((LOCK *) MAKE_PTR(holderP->tag.lock))->tag.relId == Trace_lock_table))
) )
elog(DEBUG, elog(LOG,
"%s: holder(%lx) lock(%lx) tbl(%d) proc(%lx) xid(%u) hold(%d,%d,%d,%d,%d,%d,%d)=%d", "%s: holder(%lx) lock(%lx) tbl(%d) proc(%lx) xid(%u) hold(%d,%d,%d,%d,%d,%d,%d)=%d",
where, MAKE_OFFSET(holderP), holderP->tag.lock, where, MAKE_OFFSET(holderP), holderP->tag.lock,
HOLDER_LOCKMETHOD(*(holderP)), HOLDER_LOCKMETHOD(*(holderP)),
...@@ -461,7 +461,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag, ...@@ -461,7 +461,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
if (lockmethod == USER_LOCKMETHOD && Trace_userlocks) if (lockmethod == USER_LOCKMETHOD && Trace_userlocks)
elog(DEBUG, "LockAcquire: user lock [%u] %s", elog(LOG, "LockAcquire: user lock [%u] %s",
locktag->objId.blkno, lock_mode_names[lockmode]); locktag->objId.blkno, lock_mode_names[lockmode]);
#endif #endif
...@@ -582,7 +582,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag, ...@@ -582,7 +582,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
{ {
if (i >= (int) lockmode) if (i >= (int) lockmode)
break; /* safe: we have a lock >= req level */ break; /* safe: we have a lock >= req level */
elog(DEBUG, "Deadlock risk: raising lock level" elog(LOG, "Deadlock risk: raising lock level"
" from %s to %s on object %u/%u/%u", " from %s to %s on object %u/%u/%u",
lock_mode_names[i], lock_mode_names[lockmode], lock_mode_names[i], lock_mode_names[lockmode],
lock->tag.relId, lock->tag.dbId, lock->tag.objId.blkno); lock->tag.relId, lock->tag.dbId, lock->tag.objId.blkno);
...@@ -1000,7 +1000,7 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag, ...@@ -1000,7 +1000,7 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
if (lockmethod == USER_LOCKMETHOD && Trace_userlocks) if (lockmethod == USER_LOCKMETHOD && Trace_userlocks)
elog(DEBUG, "LockRelease: user lock tag [%u] %d", locktag->objId.blkno, lockmode); elog(LOG, "LockRelease: user lock tag [%u] %d", locktag->objId.blkno, lockmode);
#endif #endif
/* ???????? This must be changed when short term locks will be used */ /* ???????? This must be changed when short term locks will be used */
...@@ -1196,7 +1196,7 @@ LockReleaseAll(LOCKMETHOD lockmethod, PROC *proc, ...@@ -1196,7 +1196,7 @@ LockReleaseAll(LOCKMETHOD lockmethod, PROC *proc,
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
if (lockmethod == USER_LOCKMETHOD ? Trace_userlocks : Trace_locks) if (lockmethod == USER_LOCKMETHOD ? Trace_userlocks : Trace_locks)
elog(DEBUG, "LockReleaseAll: lockmethod=%d, pid=%d", elog(LOG, "LockReleaseAll: lockmethod=%d, pid=%d",
lockmethod, proc->pid); lockmethod, proc->pid);
#endif #endif
...@@ -1341,7 +1341,7 @@ next_item: ...@@ -1341,7 +1341,7 @@ next_item:
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
if (lockmethod == USER_LOCKMETHOD ? Trace_userlocks : Trace_locks) if (lockmethod == USER_LOCKMETHOD ? Trace_userlocks : Trace_locks)
elog(DEBUG, "LockReleaseAll: done"); elog(LOG, "LockReleaseAll: done");
#endif #endif
return TRUE; return TRUE;
...@@ -1460,7 +1460,7 @@ DumpAllLocks(void) ...@@ -1460,7 +1460,7 @@ DumpAllLocks(void)
LOCK_PRINT("DumpAllLocks", lock, 0); LOCK_PRINT("DumpAllLocks", lock, 0);
} }
else else
elog(DEBUG, "DumpAllLocks: holder->tag.lock = NULL"); elog(LOG, "DumpAllLocks: holder->tag.lock = NULL");
} }
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lwlock.c,v 1.8 2002/01/07 16:33:00 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lwlock.c,v 1.9 2002/03/02 21:39:29 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -68,7 +68,7 @@ inline static void ...@@ -68,7 +68,7 @@ inline static void
PRINT_LWDEBUG(const char *where, LWLockId lockid, const volatile LWLock *lock) PRINT_LWDEBUG(const char *where, LWLockId lockid, const volatile LWLock *lock)
{ {
if (Trace_lwlocks) if (Trace_lwlocks)
elog(DEBUG, "%s(%d): excl %d shared %d head %p rOK %d", elog(LOG, "%s(%d): excl %d shared %d head %p rOK %d",
where, (int) lockid, where, (int) lockid,
(int) lock->exclusive, lock->shared, lock->head, (int) lock->exclusive, lock->shared, lock->head,
(int) lock->releaseOK); (int) lock->releaseOK);
...@@ -78,8 +78,7 @@ inline static void ...@@ -78,8 +78,7 @@ inline static void
LOG_LWDEBUG(const char *where, LWLockId lockid, const char *msg) LOG_LWDEBUG(const char *where, LWLockId lockid, const char *msg)
{ {
if (Trace_lwlocks) if (Trace_lwlocks)
elog(DEBUG, "%s(%d): %s", elog(LOG, "%s(%d): %s", where, (int) lockid, msg);
where, (int) lockid, msg);
} }
#else /* not LOCK_DEBUG */ #else /* not LOCK_DEBUG */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.117 2001/12/28 18:16:43 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.118 2002/03/02 21:39:29 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -211,7 +211,7 @@ InitProcess(void) ...@@ -211,7 +211,7 @@ InitProcess(void)
* we are a backend, we inherit this by fork() from the postmaster). * we are a backend, we inherit this by fork() from the postmaster).
*/ */
if (procglobal == NULL) if (procglobal == NULL)
elog(STOP, "InitProcess: Proc Header uninitialized"); elog(PANIC, "InitProcess: Proc Header uninitialized");
if (MyProc != NULL) if (MyProc != NULL)
elog(ERROR, "InitProcess: you already exist"); elog(ERROR, "InitProcess: you already exist");
...@@ -300,7 +300,7 @@ InitDummyProcess(void) ...@@ -300,7 +300,7 @@ InitDummyProcess(void)
* inherit this by fork() from the postmaster). * inherit this by fork() from the postmaster).
*/ */
if (ProcGlobal == NULL || DummyProc == NULL) if (ProcGlobal == NULL || DummyProc == NULL)
elog(STOP, "InitDummyProcess: Proc Header uninitialized"); elog(PANIC, "InitDummyProcess: Proc Header uninitialized");
if (MyProc != NULL) if (MyProc != NULL)
elog(ERROR, "InitDummyProcess: you already exist"); elog(ERROR, "InitDummyProcess: you already exist");
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.89 2001/10/28 06:25:51 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.90 2002/03/02 21:39:30 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -571,7 +571,7 @@ mdblindwrt(RelFileNode rnode, ...@@ -571,7 +571,7 @@ mdblindwrt(RelFileNode rnode,
if (lseek(fd, seekpos, SEEK_SET) != seekpos) if (lseek(fd, seekpos, SEEK_SET) != seekpos)
{ {
elog(DEBUG, "mdblindwrt: lseek(%ld) failed: %m", seekpos); elog(LOG, "mdblindwrt: lseek(%ld) failed: %m", seekpos);
close(fd); close(fd);
return SM_FAIL; return SM_FAIL;
} }
...@@ -585,13 +585,13 @@ mdblindwrt(RelFileNode rnode, ...@@ -585,13 +585,13 @@ mdblindwrt(RelFileNode rnode,
/* if write didn't set errno, assume problem is no disk space */ /* if write didn't set errno, assume problem is no disk space */
if (errno == 0) if (errno == 0)
errno = ENOSPC; errno = ENOSPC;
elog(DEBUG, "mdblindwrt: write() failed: %m"); elog(LOG, "mdblindwrt: write() failed: %m");
status = SM_FAIL; status = SM_FAIL;
} }
if (close(fd) < 0) if (close(fd) < 0)
{ {
elog(DEBUG, "mdblindwrt: close() failed: %m"); elog(LOG, "mdblindwrt: close() failed: %m");
status = SM_FAIL; status = SM_FAIL;
} }
...@@ -1085,7 +1085,7 @@ _mdfd_blind_getseg(RelFileNode rnode, BlockNumber blkno) ...@@ -1085,7 +1085,7 @@ _mdfd_blind_getseg(RelFileNode rnode, BlockNumber blkno)
/* call fd.c to allow other FDs to be closed if needed */ /* call fd.c to allow other FDs to be closed if needed */
fd = BasicOpenFile(path, O_RDWR | PG_BINARY, 0600); fd = BasicOpenFile(path, O_RDWR | PG_BINARY, 0600);
if (fd < 0) if (fd < 0)
elog(DEBUG, "_mdfd_blind_getseg: couldn't open %s: %m", path); elog(LOG, "_mdfd_blind_getseg: couldn't open %s: %m", path);
pfree(path); pfree(path);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.54 2001/10/25 05:49:43 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.55 2002/03/02 21:39:30 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -582,7 +582,7 @@ smgrsync() ...@@ -582,7 +582,7 @@ smgrsync()
if (smgrsw[i].smgr_sync) if (smgrsw[i].smgr_sync)
{ {
if ((*(smgrsw[i].smgr_sync)) () == SM_FAIL) if ((*(smgrsw[i].smgr_sync)) () == SM_FAIL)
elog(STOP, "storage sync failed on %s: %m", elog(PANIC, "storage sync failed on %s: %m",
DatumGetCString(DirectFunctionCall1(smgrout, DatumGetCString(DirectFunctionCall1(smgrout,
Int16GetDatum(i)))); Int16GetDatum(i))));
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.251 2002/03/01 22:45:13 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.252 2002/03/02 21:39:31 momjian Exp $
* *
* NOTES * NOTES
* this is the "main" module of the postgres backend and * this is the "main" module of the postgres backend and
...@@ -370,7 +370,7 @@ pg_parse_query(char *query_string, Oid *typev, int nargs) ...@@ -370,7 +370,7 @@ pg_parse_query(char *query_string, Oid *typev, int nargs)
List *raw_parsetree_list; List *raw_parsetree_list;
if (Debug_print_query) if (Debug_print_query)
elog(DEBUG, "query: %s", query_string); elog(LOG, "query: %s", query_string);
if (Show_parser_stats) if (Show_parser_stats)
ResetUsage(); ResetUsage();
...@@ -429,11 +429,11 @@ pg_analyze_and_rewrite(Node *parsetree) ...@@ -429,11 +429,11 @@ pg_analyze_and_rewrite(Node *parsetree)
{ {
if (Debug_pretty_print) if (Debug_pretty_print)
{ {
elog(DEBUG, "parse tree:"); elog(LOG, "parse tree:");
nodeDisplay(querytree); nodeDisplay(querytree);
} }
else else
elog(DEBUG, "parse tree: %s", nodeToString(querytree)); elog(LOG, "parse tree: %s", nodeToString(querytree));
} }
if (querytree->commandType == CMD_UTILITY) if (querytree->commandType == CMD_UTILITY)
...@@ -473,7 +473,7 @@ pg_analyze_and_rewrite(Node *parsetree) ...@@ -473,7 +473,7 @@ pg_analyze_and_rewrite(Node *parsetree)
{ {
if (Debug_pretty_print) if (Debug_pretty_print)
{ {
elog(DEBUG, "rewritten parse tree:"); elog(LOG, "rewritten parse tree:");
foreach(list_item, querytree_list) foreach(list_item, querytree_list)
{ {
querytree = (Query *) lfirst(list_item); querytree = (Query *) lfirst(list_item);
...@@ -483,11 +483,11 @@ pg_analyze_and_rewrite(Node *parsetree) ...@@ -483,11 +483,11 @@ pg_analyze_and_rewrite(Node *parsetree)
} }
else else
{ {
elog(DEBUG, "rewritten parse tree:"); elog(LOG, "rewritten parse tree:");
foreach(list_item, querytree_list) foreach(list_item, querytree_list)
{ {
querytree = (Query *) lfirst(list_item); querytree = (Query *) lfirst(list_item);
elog(DEBUG, "%s", nodeToString(querytree)); elog(LOG, "%s", nodeToString(querytree));
} }
} }
} }
...@@ -541,11 +541,11 @@ pg_plan_query(Query *querytree) ...@@ -541,11 +541,11 @@ pg_plan_query(Query *querytree)
{ {
if (Debug_pretty_print) if (Debug_pretty_print)
{ {
elog(DEBUG, "plan:"); elog(LOG, "plan:");
nodeDisplay(plan); nodeDisplay(plan);
} }
else else
elog(DEBUG, "plan: %s", nodeToString(plan)); elog(LOG, "plan: %s", nodeToString(plan));
} }
return plan; return plan;
...@@ -759,9 +759,8 @@ pg_exec_query_string(char *query_string, /* string to execute */ ...@@ -759,9 +759,8 @@ pg_exec_query_string(char *query_string, /* string to execute */
* process utility functions (create, destroy, etc..) * process utility functions (create, destroy, etc..)
*/ */
if (Debug_print_query) if (Debug_print_query)
elog(DEBUG, "ProcessUtility: %s", query_string); elog(LOG, "ProcessUtility: %s", query_string);
else if (DebugLvl > 1) else elog(DEBUG2, "ProcessUtility");
elog(DEBUG, "ProcessUtility");
if (querytree->originalQuery) if (querytree->originalQuery)
{ {
...@@ -805,8 +804,7 @@ pg_exec_query_string(char *query_string, /* string to execute */ ...@@ -805,8 +804,7 @@ pg_exec_query_string(char *query_string, /* string to execute */
} }
else else
{ {
if (DebugLvl > 1) elog(DEBUG2, "ProcessQuery");
elog(DEBUG, "ProcessQuery");
if (querytree->originalQuery) if (querytree->originalQuery)
{ {
...@@ -916,8 +914,7 @@ pg_exec_query_string(char *query_string, /* string to execute */ ...@@ -916,8 +914,7 @@ pg_exec_query_string(char *query_string, /* string to execute */
static void static void
start_xact_command(void) start_xact_command(void)
{ {
if (DebugLvl >= 1) elog(DEBUG1, "StartTransactionCommand");
elog(DEBUG, "StartTransactionCommand");
StartTransactionCommand(); StartTransactionCommand();
} }
...@@ -928,8 +925,7 @@ finish_xact_command(void) ...@@ -928,8 +925,7 @@ finish_xact_command(void)
DeferredTriggerEndQuery(); DeferredTriggerEndQuery();
/* Now commit the command */ /* Now commit the command */
if (DebugLvl >= 1) elog(DEBUG1, "CommitTransactionCommand");
elog(DEBUG, "CommitTransactionCommand");
CommitTransactionCommand(); CommitTransactionCommand();
...@@ -1130,7 +1126,7 @@ usage(char *progname) ...@@ -1130,7 +1126,7 @@ usage(char *progname)
#endif #endif
printf(" -B NBUFFERS number of shared buffers (default %d)\n", DEF_NBUFFERS); printf(" -B NBUFFERS number of shared buffers (default %d)\n", DEF_NBUFFERS);
printf(" -c NAME=VALUE set run-time parameter\n"); printf(" -c NAME=VALUE set run-time parameter\n");
printf(" -d 1-5 debugging level\n"); printf(" -d 1-5,0 debugging level (0 is off)\n");
printf(" -D DATADIR database directory\n"); printf(" -D DATADIR database directory\n");
printf(" -e use European date format\n"); printf(" -e use European date format\n");
printf(" -E echo query before execution\n"); printf(" -E echo query before execution\n");
...@@ -1281,17 +1277,37 @@ PostgresMain(int argc, char *argv[], const char *username) ...@@ -1281,17 +1277,37 @@ PostgresMain(int argc, char *argv[], const char *username)
break; break;
case 'd': /* debug level */ case 'd': /* debug level */
SetConfigOption("debug_level", optarg, ctx, gucsource); {
if (DebugLvl >= 1) /* Set server debugging level. */
SetConfigOption("log_connections", "true", ctx, gucsource); if (atoi(optarg) != 0)
if (DebugLvl >= 2) {
SetConfigOption("debug_print_query", "true", ctx, gucsource); char *debugstr = palloc(strlen("debug") + strlen(optarg) + 1);
if (DebugLvl >= 3)
SetConfigOption("debug_print_parse", "true", ctx, gucsource); sprintf(debugstr, "debug%s", optarg);
if (DebugLvl >= 4) SetConfigOption("server_min_messages", debugstr, ctx, gucsource);
SetConfigOption("debug_print_plan", "true", ctx, gucsource); pfree(debugstr);
if (DebugLvl >= 5) /*
SetConfigOption("debug_print_rewritten", "true", ctx, gucsource); * -d is not the same as setting client_min_messages
* because it enables other output options.
*/
if (atoi(optarg) >= 1)
SetConfigOption("log_connections", "true", ctx, gucsource);
if (atoi(optarg) >= 2)
SetConfigOption("debug_print_query", "true", ctx, gucsource);
if (atoi(optarg) >= 3)
SetConfigOption("debug_print_parse", "true", ctx, gucsource);
if (atoi(optarg) >= 4)
SetConfigOption("debug_print_plan", "true", ctx, gucsource);
if (atoi(optarg) >= 5)
SetConfigOption("debug_print_rewritten", "true", ctx, gucsource);
}
else
/*
* -d 0 allows user to prevent postmaster debug from
* propogating to backend.
*/
SetConfigOption("server_min_messages", "notice", PGC_POSTMASTER, PGC_S_ARGV);
}
break; break;
case 'E': case 'E':
...@@ -1682,8 +1698,7 @@ PostgresMain(int argc, char *argv[], const char *username) ...@@ -1682,8 +1698,7 @@ PostgresMain(int argc, char *argv[], const char *username)
* putting it inside InitPostgres() instead. In particular, anything * putting it inside InitPostgres() instead. In particular, anything
* that involves database access should be there, not here. * that involves database access should be there, not here.
*/ */
if (DebugLvl > 1) elog(DEBUG2, "InitPostgres");
elog(DEBUG, "InitPostgres");
InitPostgres(DBName, username); InitPostgres(DBName, username);
SetProcessingMode(NormalProcessing); SetProcessingMode(NormalProcessing);
...@@ -1707,7 +1722,7 @@ PostgresMain(int argc, char *argv[], const char *username) ...@@ -1707,7 +1722,7 @@ PostgresMain(int argc, char *argv[], const char *username)
if (!IsUnderPostmaster) if (!IsUnderPostmaster)
{ {
puts("\nPOSTGRES backend interactive interface "); puts("\nPOSTGRES backend interactive interface ");
puts("$Revision: 1.251 $ $Date: 2002/03/01 22:45:13 $\n"); puts("$Revision: 1.252 $ $Date: 2002/03/02 21:39:31 $\n");
} }
/* /*
...@@ -1765,8 +1780,7 @@ PostgresMain(int argc, char *argv[], const char *username) ...@@ -1765,8 +1780,7 @@ PostgresMain(int argc, char *argv[], const char *username)
MemoryContextSwitchTo(ErrorContext); MemoryContextSwitchTo(ErrorContext);
/* Do the recovery */ /* Do the recovery */
if (DebugLvl >= 1) elog(DEBUG1, "AbortCurrentTransaction");
elog(DEBUG, "AbortCurrentTransaction");
AbortCurrentTransaction(); AbortCurrentTransaction();
/* /*
...@@ -2086,7 +2100,7 @@ ShowUsage(const char *title) ...@@ -2086,7 +2100,7 @@ ShowUsage(const char *title)
if (str.data[str.len-1] == '\n') if (str.data[str.len-1] == '\n')
str.data[--str.len] = '\0'; str.data[--str.len] = '\0';
elog(DEBUG, "%s\n%s", title, str.data); elog(LOG, "%s\n%s", title, str.data);
pfree(str.data); pfree(str.data);
} }
...@@ -2108,10 +2122,10 @@ assertTest(int val) ...@@ -2108,10 +2122,10 @@ assertTest(int val)
if (assert_enabled) if (assert_enabled)
{ {
/* val != 0 should be trapped by previous Assert */ /* val != 0 should be trapped by previous Assert */
elog(NOTICE, "Assert test successfull (val = %d)", val); elog(INFO, "Assert test successfull (val = %d)", val);
} }
else else
elog(NOTICE, "Assert checking is disabled (val = %d)", val); elog(INFO, "Assert checking is disabled (val = %d)", val);
return val; return val;
} }
...@@ -2383,7 +2397,7 @@ CreateCommandTag(Node *parsetree) ...@@ -2383,7 +2397,7 @@ CreateCommandTag(Node *parsetree)
break; break;
default: default:
elog(DEBUG, "CreateCommandTag: unknown parse node type %d", elog(LOG, "CreateCommandTag: unknown parse node type %d",
nodeTag(parsetree)); nodeTag(parsetree));
tag = "???"; tag = "???";
break; break;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.67 2002/02/18 23:11:22 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.68 2002/03/02 21:39:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -122,7 +122,7 @@ aclparse(const char *s, AclItem *aip, unsigned *modechg) ...@@ -122,7 +122,7 @@ aclparse(const char *s, AclItem *aip, unsigned *modechg)
Assert(s && aip && modechg); Assert(s && aip && modechg);
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "aclparse: input = '%s'", s); elog(LOG, "aclparse: input = '%s'", s);
#endif #endif
aip->ai_idtype = ACL_IDTYPE_UID; aip->ai_idtype = ACL_IDTYPE_UID;
s = getid(s, name); s = getid(s, name);
...@@ -204,7 +204,7 @@ aclparse(const char *s, AclItem *aip, unsigned *modechg) ...@@ -204,7 +204,7 @@ aclparse(const char *s, AclItem *aip, unsigned *modechg)
} }
#ifdef ACLDEBUG #ifdef ACLDEBUG
elog(DEBUG, "aclparse: correctly read [%x %d %x], modechg=%x", elog(LOG, "aclparse: correctly read [%x %d %x], modechg=%x",
aip->ai_idtype, aip->ai_id, aip->ai_mode, *modechg); aip->ai_idtype, aip->ai_id, aip->ai_mode, *modechg);
#endif #endif
return s; return s;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/format_type.c,v 1.23 2001/11/19 19:51:20 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/format_type.c,v 1.24 2002/03/02 21:39:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -294,7 +294,7 @@ format_type_internal(Oid type_oid, int32 typemod, ...@@ -294,7 +294,7 @@ format_type_internal(Oid type_oid, int32 typemod,
fieldstr = ""; fieldstr = "";
break; break;
default: default:
elog(DEBUG, "Invalid INTERVAL typmod 0x%x", typemod); elog(LOG, "Invalid INTERVAL typmod 0x%x", typemod);
fieldstr = ""; fieldstr = "";
break; break;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* The PostgreSQL locale utils. * The PostgreSQL locale utils.
* *
* *
* $Header: /cvsroot/pgsql/src/backend/utils/adt/pg_locale.c,v 1.13 2001/11/05 17:46:29 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/pg_locale.c,v 1.14 2002/03/02 21:39:32 momjian Exp $
* *
* Portions Copyright (c) 1999-2000, PostgreSQL Global Development Group * Portions Copyright (c) 1999-2000, PostgreSQL Global Development Group
* *
...@@ -86,7 +86,7 @@ static void ...@@ -86,7 +86,7 @@ static void
PGLC_debug_lc(PG_LocaleCategories *lc) PGLC_debug_lc(PG_LocaleCategories *lc)
{ {
#ifdef LC_MESSAGES #ifdef LC_MESSAGES
elog(DEBUG, "CURRENT LOCALE ENVIRONMENT:\n\nLANG: \t%s\nLC_CTYPE:\t%s\nLC_NUMERIC:\t%s\nLC_TIME:\t%s\nLC_COLLATE:\t%s\nLC_MONETARY:\t%s\nLC_MESSAGES:\t%s\n", elog(LOG, "CURRENT LOCALE ENVIRONMENT:\n\nLANG: \t%s\nLC_CTYPE:\t%s\nLC_NUMERIC:\t%s\nLC_TIME:\t%s\nLC_COLLATE:\t%s\nLC_MONETARY:\t%s\nLC_MESSAGES:\t%s\n",
lc->lang, lc->lang,
lc->lc_ctype, lc->lc_ctype,
lc->lc_numeric, lc->lc_numeric,
...@@ -95,7 +95,7 @@ PGLC_debug_lc(PG_LocaleCategories *lc) ...@@ -95,7 +95,7 @@ PGLC_debug_lc(PG_LocaleCategories *lc)
lc->lc_monetary, lc->lc_monetary,
lc->lc_messages); lc->lc_messages);
#else #else
elog(DEBUG, "CURRENT LOCALE ENVIRONMENT:\n\nLANG: \t%s\nLC_CTYPE:\t%s\nLC_NUMERIC:\t%s\nLC_TIME:\t%s\nLC_COLLATE:\t%s\nLC_MONETARY:\t%s\n", elog(LOG, "CURRENT LOCALE ENVIRONMENT:\n\nLANG: \t%s\nLC_CTYPE:\t%s\nLC_NUMERIC:\t%s\nLC_TIME:\t%s\nLC_COLLATE:\t%s\nLC_MONETARY:\t%s\n",
lc->lang, lc->lang,
lc->lc_ctype, lc->lc_ctype,
lc->lc_numeric, lc->lc_numeric,
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.104 2002/03/01 04:09:25 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.105 2002/03/02 21:39:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -3169,7 +3169,7 @@ locale_is_like_safe(void) ...@@ -3169,7 +3169,7 @@ locale_is_like_safe(void)
return (bool) result; return (bool) result;
localeptr = setlocale(LC_COLLATE, NULL); localeptr = setlocale(LC_COLLATE, NULL);
if (!localeptr) if (!localeptr)
elog(STOP, "Invalid LC_COLLATE setting"); elog(PANIC, "Invalid LC_COLLATE setting");
/* /*
* Currently we accept only "C" and "POSIX" (do any systems still * Currently we accept only "C" and "POSIX" (do any systems still
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.88 2002/02/25 04:06:50 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.89 2002/03/02 21:39:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -146,14 +146,14 @@ CatCachePrintStats(void) ...@@ -146,14 +146,14 @@ CatCachePrintStats(void)
long cc_hits = 0; long cc_hits = 0;
long cc_newloads = 0; long cc_newloads = 0;
elog(DEBUG, "Catcache stats dump: %d/%d tuples in catcaches", elog(LOG, "Catcache stats dump: %d/%d tuples in catcaches",
CacheHdr->ch_ntup, CacheHdr->ch_maxtup); CacheHdr->ch_ntup, CacheHdr->ch_maxtup);
for (cache = CacheHdr->ch_caches; cache; cache = cache->cc_next) for (cache = CacheHdr->ch_caches; cache; cache = cache->cc_next)
{ {
if (cache->cc_ntup == 0 && cache->cc_searches == 0) if (cache->cc_ntup == 0 && cache->cc_searches == 0)
continue; /* don't print unused caches */ continue; /* don't print unused caches */
elog(DEBUG, "Catcache %s/%s: %d tup, %ld srch, %ld hits, %ld loads, %ld not found", elog(LOG, "Catcache %s/%s: %d tup, %ld srch, %ld hits, %ld loads, %ld not found",
cache->cc_relname, cache->cc_relname,
cache->cc_indname, cache->cc_indname,
cache->cc_ntup, cache->cc_ntup,
...@@ -165,7 +165,7 @@ CatCachePrintStats(void) ...@@ -165,7 +165,7 @@ CatCachePrintStats(void)
cc_hits += cache->cc_hits; cc_hits += cache->cc_hits;
cc_newloads += cache->cc_newloads; cc_newloads += cache->cc_newloads;
} }
elog(DEBUG, "Catcache totals: %d tup, %ld srch, %ld hits, %ld loads, %ld not found", elog(LOG, "Catcache totals: %d tup, %ld srch, %ld hits, %ld loads, %ld not found",
CacheHdr->ch_ntup, CacheHdr->ch_ntup,
cc_searches, cc_searches,
cc_hits, cc_hits,
...@@ -208,17 +208,17 @@ CreateCacheMemoryContext(void) ...@@ -208,17 +208,17 @@ CreateCacheMemoryContext(void)
*/ */
#ifdef CACHEDEBUG #ifdef CACHEDEBUG
#define CatalogCacheInitializeCache_DEBUG1 \ #define CatalogCacheInitializeCache_DEBUG1 \
elog(DEBUG, "CatalogCacheInitializeCache: cache @%p %s", cache, \ elog(LOG, "CatalogCacheInitializeCache: cache @%p %s", cache, \
cache->cc_relname) cache->cc_relname)
#define CatalogCacheInitializeCache_DEBUG2 \ #define CatalogCacheInitializeCache_DEBUG2 \
do { \ do { \
if (cache->cc_key[i] > 0) { \ if (cache->cc_key[i] > 0) { \
elog(DEBUG, "CatalogCacheInitializeCache: load %d/%d w/%d, %u", \ elog(LOG, "CatalogCacheInitializeCache: load %d/%d w/%d, %u", \
i+1, cache->cc_nkeys, cache->cc_key[i], \ i+1, cache->cc_nkeys, cache->cc_key[i], \
tupdesc->attrs[cache->cc_key[i] - 1]->atttypid); \ tupdesc->attrs[cache->cc_key[i] - 1]->atttypid); \
} else { \ } else { \
elog(DEBUG, "CatalogCacheInitializeCache: load %d/%d w/%d", \ elog(LOG, "CatalogCacheInitializeCache: load %d/%d w/%d", \
i+1, cache->cc_nkeys, cache->cc_key[i]); \ i+1, cache->cc_nkeys, cache->cc_key[i]); \
} \ } \
} while(0) } while(0)
...@@ -270,7 +270,7 @@ CatalogCacheInitializeCache(CatCache *cache) ...@@ -270,7 +270,7 @@ CatalogCacheInitializeCache(CatCache *cache)
heap_close(relation, NoLock); heap_close(relation, NoLock);
CACHE3_elog(DEBUG, "CatalogCacheInitializeCache: %s, %d keys", CACHE3_elog(LOG, "CatalogCacheInitializeCache: %s, %d keys",
cache->cc_relname, cache->cc_nkeys); cache->cc_relname, cache->cc_nkeys);
/* /*
...@@ -306,7 +306,7 @@ CatalogCacheInitializeCache(CatCache *cache) ...@@ -306,7 +306,7 @@ CatalogCacheInitializeCache(CatCache *cache)
/* Initialize sk_attno suitably for HeapKeyTest() and heap scans */ /* Initialize sk_attno suitably for HeapKeyTest() and heap scans */
cache->cc_skey[i].sk_attno = cache->cc_key[i]; cache->cc_skey[i].sk_attno = cache->cc_key[i];
CACHE4_elog(DEBUG, "CatalogCacheInit %s %d %p", CACHE4_elog(LOG, "CatalogCacheInit %s %d %p",
cache->cc_relname, cache->cc_relname,
i, i,
cache); cache);
...@@ -350,7 +350,7 @@ CatalogCacheComputeHashIndex(CatCache *cache, ScanKey cur_skey) ...@@ -350,7 +350,7 @@ CatalogCacheComputeHashIndex(CatCache *cache, ScanKey cur_skey)
{ {
uint32 hashIndex = 0; uint32 hashIndex = 0;
CACHE4_elog(DEBUG, "CatalogCacheComputeHashIndex %s %d %p", CACHE4_elog(LOG, "CatalogCacheComputeHashIndex %s %d %p",
cache->cc_relname, cache->cc_relname,
cache->cc_nkeys, cache->cc_nkeys,
cache); cache);
...@@ -491,7 +491,7 @@ CatalogCacheIdInvalidate(int cacheId, ...@@ -491,7 +491,7 @@ CatalogCacheIdInvalidate(int cacheId,
* sanity checks * sanity checks
*/ */
Assert(ItemPointerIsValid(pointer)); Assert(ItemPointerIsValid(pointer));
CACHE1_elog(DEBUG, "CatalogCacheIdInvalidate: called"); CACHE1_elog(LOG, "CatalogCacheIdInvalidate: called");
/* /*
* inspect caches to find the proper cache * inspect caches to find the proper cache
...@@ -521,7 +521,7 @@ CatalogCacheIdInvalidate(int cacheId, ...@@ -521,7 +521,7 @@ CatalogCacheIdInvalidate(int cacheId,
ct->dead = true; ct->dead = true;
else else
CatCacheRemoveCTup(ccp, ct); CatCacheRemoveCTup(ccp, ct);
CACHE1_elog(DEBUG, "CatalogCacheIdInvalidate: invalidated"); CACHE1_elog(LOG, "CatalogCacheIdInvalidate: invalidated");
/* could be multiple matches, so keep looking! */ /* could be multiple matches, so keep looking! */
} }
} }
...@@ -623,12 +623,12 @@ ResetCatalogCaches(void) ...@@ -623,12 +623,12 @@ ResetCatalogCaches(void)
{ {
CatCache *cache; CatCache *cache;
CACHE1_elog(DEBUG, "ResetCatalogCaches called"); CACHE1_elog(LOG, "ResetCatalogCaches called");
for (cache = CacheHdr->ch_caches; cache; cache = cache->cc_next) for (cache = CacheHdr->ch_caches; cache; cache = cache->cc_next)
ResetCatalogCache(cache); ResetCatalogCache(cache);
CACHE1_elog(DEBUG, "end of ResetCatalogCaches call"); CACHE1_elog(LOG, "end of ResetCatalogCaches call");
} }
/* /*
...@@ -656,7 +656,7 @@ CatalogCacheFlushRelation(Oid relId) ...@@ -656,7 +656,7 @@ CatalogCacheFlushRelation(Oid relId)
{ {
CatCache *cache; CatCache *cache;
CACHE2_elog(DEBUG, "CatalogCacheFlushRelation called for %u", relId); CACHE2_elog(LOG, "CatalogCacheFlushRelation called for %u", relId);
for (cache = CacheHdr->ch_caches; cache; cache = cache->cc_next) for (cache = CacheHdr->ch_caches; cache; cache = cache->cc_next)
{ {
...@@ -716,7 +716,7 @@ CatalogCacheFlushRelation(Oid relId) ...@@ -716,7 +716,7 @@ CatalogCacheFlushRelation(Oid relId)
} }
} }
CACHE1_elog(DEBUG, "end of CatalogCacheFlushRelation call"); CACHE1_elog(LOG, "end of CatalogCacheFlushRelation call");
} }
/* /*
...@@ -730,7 +730,7 @@ CatalogCacheFlushRelation(Oid relId) ...@@ -730,7 +730,7 @@ CatalogCacheFlushRelation(Oid relId)
#ifdef CACHEDEBUG #ifdef CACHEDEBUG
#define InitCatCache_DEBUG1 \ #define InitCatCache_DEBUG1 \
do { \ do { \
elog(DEBUG, "InitCatCache: rel=%s id=%d nkeys=%d size=%d\n", \ elog(LOG, "InitCatCache: rel=%s id=%d nkeys=%d size=%d\n", \
cp->cc_relname, cp->id, cp->cc_nkeys, cp->cc_size); \ cp->cc_relname, cp->id, cp->cc_nkeys, cp->cc_size); \
} while(0) } while(0)
...@@ -958,7 +958,7 @@ SearchCatCache(CatCache *cache, ...@@ -958,7 +958,7 @@ SearchCatCache(CatCache *cache,
DLMoveToFront(&ct->cache_elem); DLMoveToFront(&ct->cache_elem);
#ifdef CACHEDEBUG #ifdef CACHEDEBUG
CACHE3_elog(DEBUG, "SearchCatCache(%s): found in bucket %d", CACHE3_elog(LOG, "SearchCatCache(%s): found in bucket %d",
cache->cc_relname, hash); cache->cc_relname, hash);
#endif /* CACHEDEBUG */ #endif /* CACHEDEBUG */
...@@ -1006,7 +1006,7 @@ SearchCatCache(CatCache *cache, ...@@ -1006,7 +1006,7 @@ SearchCatCache(CatCache *cache,
Buffer buffer; Buffer buffer;
int i; int i;
CACHE2_elog(DEBUG, "SearchCatCache(%s): performing index scan", CACHE2_elog(LOG, "SearchCatCache(%s): performing index scan",
cache->cc_relname); cache->cc_relname);
/* /*
...@@ -1045,7 +1045,7 @@ SearchCatCache(CatCache *cache, ...@@ -1045,7 +1045,7 @@ SearchCatCache(CatCache *cache,
{ {
HeapScanDesc sd; HeapScanDesc sd;
CACHE2_elog(DEBUG, "SearchCatCache(%s): performing heap scan", CACHE2_elog(LOG, "SearchCatCache(%s): performing heap scan",
cache->cc_relname); cache->cc_relname);
sd = heap_beginscan(relation, 0, SnapshotNow, sd = heap_beginscan(relation, 0, SnapshotNow,
...@@ -1081,7 +1081,7 @@ SearchCatCache(CatCache *cache, ...@@ -1081,7 +1081,7 @@ SearchCatCache(CatCache *cache,
* Finish initializing the CatCTup header, and add it to the linked * Finish initializing the CatCTup header, and add it to the linked
* lists. * lists.
*/ */
CACHE1_elog(DEBUG, "SearchCatCache: found tuple"); CACHE1_elog(LOG, "SearchCatCache: found tuple");
ct->ct_magic = CT_MAGIC; ct->ct_magic = CT_MAGIC;
ct->my_cache = cache; ct->my_cache = cache;
...@@ -1112,7 +1112,7 @@ SearchCatCache(CatCache *cache, ...@@ -1112,7 +1112,7 @@ SearchCatCache(CatCache *cache,
if (oldct->refcount == 0) if (oldct->refcount == 0)
{ {
CACHE2_elog(DEBUG, "SearchCatCache(%s): Overflow, LRU removal", CACHE2_elog(LOG, "SearchCatCache(%s): Overflow, LRU removal",
cache->cc_relname); cache->cc_relname);
CatCacheRemoveCTup(oldct->my_cache, oldct); CatCacheRemoveCTup(oldct->my_cache, oldct);
break; break;
...@@ -1120,9 +1120,9 @@ SearchCatCache(CatCache *cache, ...@@ -1120,9 +1120,9 @@ SearchCatCache(CatCache *cache,
} }
} }
CACHE4_elog(DEBUG, "SearchCatCache(%s): Contains %d/%d tuples", CACHE4_elog(LOG, "SearchCatCache(%s): Contains %d/%d tuples",
cache->cc_relname, cache->cc_ntup, CacheHdr->ch_ntup); cache->cc_relname, cache->cc_ntup, CacheHdr->ch_ntup);
CACHE3_elog(DEBUG, "SearchCatCache(%s): put in bucket %d", CACHE3_elog(LOG, "SearchCatCache(%s): put in bucket %d",
cache->cc_relname, hash); cache->cc_relname, hash);
return &ct->tuple; return &ct->tuple;
...@@ -1194,7 +1194,7 @@ PrepareToInvalidateCacheTuple(Relation relation, ...@@ -1194,7 +1194,7 @@ PrepareToInvalidateCacheTuple(Relation relation,
{ {
CatCache *ccp; CatCache *ccp;
CACHE1_elog(DEBUG, "PrepareToInvalidateCacheTuple: called"); CACHE1_elog(LOG, "PrepareToInvalidateCacheTuple: called");
/* /*
* sanity checks * sanity checks
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.54 2001/10/25 05:49:48 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.55 2002/03/02 21:39:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -399,8 +399,7 @@ find_in_dynamic_libpath(const char *basename) ...@@ -399,8 +399,7 @@ find_in_dynamic_libpath(const char *basename)
sprintf(full, "%s/%s", mangled, basename); sprintf(full, "%s/%s", mangled, basename);
pfree(mangled); pfree(mangled);
if (DebugLvl > 1) elog(DEBUG2, "find_in_dynamic_libpath: trying %s", full);
elog(DEBUG, "find_in_dynamic_libpath: trying %s", full);
if (file_exists(full)) if (file_exists(full))
return full; return full;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.40 2001/10/28 06:25:54 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.41 2002/03/02 21:39:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -933,7 +933,7 @@ hash_corrupted(HTAB *hashp) ...@@ -933,7 +933,7 @@ hash_corrupted(HTAB *hashp)
* systemwide restart. Otherwise, just shut down this one backend. * systemwide restart. Otherwise, just shut down this one backend.
*/ */
if (hashp->isshared) if (hashp->isshared)
elog(STOP, "Hash table '%s' corrupted", hashp->tabname); elog(PANIC, "Hash table '%s' corrupted", hashp->tabname);
else else
elog(FATAL, "Hash table '%s' corrupted", hashp->tabname); elog(FATAL, "Hash table '%s' corrupted", hashp->tabname);
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.26 2002/02/08 16:30:11 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.27 2002/03/02 21:39:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -61,17 +61,13 @@ ValidateBinary(char *path) ...@@ -61,17 +61,13 @@ ValidateBinary(char *path)
*/ */
if (stat(path, &buf) < 0) if (stat(path, &buf) < 0)
{ {
if (DebugLvl > 1) elog(DEBUG2, "ValidateBinary: can't stat \"%s\"", path);
fprintf(stderr, "ValidateBinary: can't stat \"%s\"\n",
path);
return -1; return -1;
} }
if ((buf.st_mode & S_IFMT) != S_IFREG) if ((buf.st_mode & S_IFMT) != S_IFREG)
{ {
if (DebugLvl > 1) elog(DEBUG2, "ValidateBinary: \"%s\" is not a regular file", path);
fprintf(stderr, "ValidateBinary: \"%s\" is not a regular file\n",
path);
return -1; return -1;
} }
...@@ -92,9 +88,8 @@ ValidateBinary(char *path) ...@@ -92,9 +88,8 @@ ValidateBinary(char *path)
{ {
is_r = buf.st_mode & S_IRUSR; is_r = buf.st_mode & S_IRUSR;
is_x = buf.st_mode & S_IXUSR; is_x = buf.st_mode & S_IXUSR;
if (DebugLvl > 1 && !(is_r && is_x)) if (!(is_r && is_x))
fprintf(stderr, "ValidateBinary: \"%s\" is not user read/execute\n", elog(DEBUG2, "ValidateBinary: \"%s\" is not user read/execute", path);
path);
return is_x ? (is_r ? 0 : -2) : -1; return is_x ? (is_r ? 0 : -2) : -1;
} }
pwp = getpwuid(euid); pwp = getpwuid(euid);
...@@ -119,17 +114,17 @@ ValidateBinary(char *path) ...@@ -119,17 +114,17 @@ ValidateBinary(char *path)
{ {
is_r = buf.st_mode & S_IRGRP; is_r = buf.st_mode & S_IRGRP;
is_x = buf.st_mode & S_IXGRP; is_x = buf.st_mode & S_IXGRP;
if (DebugLvl > 1 && !(is_r && is_x)) if (!(is_r && is_x))
fprintf(stderr, "ValidateBinary: \"%s\" is not group read/execute\n", elog(DEBUG2, "ValidateBinary: \"%s\" is not group read/execute",
path); path);
return is_x ? (is_r ? 0 : -2) : -1; return is_x ? (is_r ? 0 : -2) : -1;
} }
} }
is_r = buf.st_mode & S_IROTH; is_r = buf.st_mode & S_IROTH;
is_x = buf.st_mode & S_IXOTH; is_x = buf.st_mode & S_IXOTH;
if (DebugLvl > 1 && !(is_r && is_x)) if (!(is_r && is_x))
fprintf(stderr, "ValidateBinary: \"%s\" is not other read/execute\n", elog(DEBUG2, "ValidateBinary: \"%s\" is not other read/execute",
path); path);
return is_x ? (is_r ? 0 : -2) : -1; return is_x ? (is_r ? 0 : -2) : -1;
} }
...@@ -177,9 +172,7 @@ FindExec(char *full_path, const char *argv0, const char *binary_name) ...@@ -177,9 +172,7 @@ FindExec(char *full_path, const char *argv0, const char *binary_name)
if (ValidateBinary(buf) == 0) if (ValidateBinary(buf) == 0)
{ {
strncpy(full_path, buf, MAXPGPATH); strncpy(full_path, buf, MAXPGPATH);
if (DebugLvl) elog(DEBUG1, "FindExec: found \"%s\" using argv[0]", full_path);
fprintf(stderr, "FindExec: found \"%s\" using argv[0]\n",
full_path);
return 0; return 0;
} }
fprintf(stderr, "FindExec: invalid binary \"%s\"\n", fprintf(stderr, "FindExec: invalid binary \"%s\"\n",
...@@ -193,8 +186,7 @@ FindExec(char *full_path, const char *argv0, const char *binary_name) ...@@ -193,8 +186,7 @@ FindExec(char *full_path, const char *argv0, const char *binary_name)
*/ */
if ((p = getenv("PATH")) && *p) if ((p = getenv("PATH")) && *p)
{ {
if (DebugLvl) elog(DEBUG1, "FindExec: searching PATH ...");
fprintf(stderr, "FindExec: searching PATH ...\n");
path = strdup(p); /* make a modifiable copy */ path = strdup(p); /* make a modifiable copy */
for (startp = path, endp = strchr(path, ':'); for (startp = path, endp = strchr(path, ':');
startp && *startp; startp && *startp;
...@@ -215,9 +207,8 @@ FindExec(char *full_path, const char *argv0, const char *binary_name) ...@@ -215,9 +207,8 @@ FindExec(char *full_path, const char *argv0, const char *binary_name)
{ {
case 0: /* found ok */ case 0: /* found ok */
strncpy(full_path, buf, MAXPGPATH); strncpy(full_path, buf, MAXPGPATH);
if (DebugLvl) elog(DEBUG1, "FindExec: found \"%s\" using PATH",
fprintf(stderr, "FindExec: found \"%s\" using PATH\n", full_path);
full_path);
free(path); free(path);
return 0; return 0;
case -1: /* wasn't even a candidate, keep looking */ case -1: /* wasn't even a candidate, keep looking */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.62 2001/10/25 05:49:51 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.63 2002/03/02 21:39:33 momjian Exp $
* *
* NOTES * NOTES
* Globals used all over the place should be declared here and not * Globals used all over the place should be declared here and not
...@@ -69,8 +69,6 @@ Oid MyDatabaseId = InvalidOid; ...@@ -69,8 +69,6 @@ Oid MyDatabaseId = InvalidOid;
bool IsUnderPostmaster = false; bool IsUnderPostmaster = false;
int DebugLvl = 0;
int DateStyle = USE_ISO_DATES; int DateStyle = USE_ISO_DATES;
bool EuroDates = false; bool EuroDates = false;
bool HasCTZSet = false; bool HasCTZSet = false;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.83 2002/03/01 22:45:15 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.84 2002/03/02 21:39:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -817,13 +817,13 @@ RecordSharedMemoryInLockFile(IpcMemoryKey shmKey, IpcMemoryId shmId) ...@@ -817,13 +817,13 @@ RecordSharedMemoryInLockFile(IpcMemoryKey shmKey, IpcMemoryId shmId)
fd = open(directoryLockFile, O_RDWR | PG_BINARY, 0); fd = open(directoryLockFile, O_RDWR | PG_BINARY, 0);
if (fd < 0) if (fd < 0)
{ {
elog(DEBUG, "Failed to rewrite %s: %m", directoryLockFile); elog(LOG, "Failed to rewrite %s: %m", directoryLockFile);
return; return;
} }
len = read(fd, buffer, sizeof(buffer) - 100); len = read(fd, buffer, sizeof(buffer) - 100);
if (len <= 0) if (len <= 0)
{ {
elog(DEBUG, "Failed to read %s: %m", directoryLockFile); elog(LOG, "Failed to read %s: %m", directoryLockFile);
close(fd); close(fd);
return; return;
} }
...@@ -836,7 +836,7 @@ RecordSharedMemoryInLockFile(IpcMemoryKey shmKey, IpcMemoryId shmId) ...@@ -836,7 +836,7 @@ RecordSharedMemoryInLockFile(IpcMemoryKey shmKey, IpcMemoryId shmId)
if (ptr == NULL || if (ptr == NULL ||
(ptr = strchr(ptr + 1, '\n')) == NULL) (ptr = strchr(ptr + 1, '\n')) == NULL)
{ {
elog(DEBUG, "Bogus data in %s", directoryLockFile); elog(LOG, "Bogus data in %s", directoryLockFile);
close(fd); close(fd);
return; return;
} }
...@@ -861,7 +861,7 @@ RecordSharedMemoryInLockFile(IpcMemoryKey shmKey, IpcMemoryId shmId) ...@@ -861,7 +861,7 @@ RecordSharedMemoryInLockFile(IpcMemoryKey shmKey, IpcMemoryId shmId)
/* if write didn't set errno, assume problem is no disk space */ /* if write didn't set errno, assume problem is no disk space */
if (errno == 0) if (errno == 0)
errno = ENOSPC; errno = ENOSPC;
elog(DEBUG, "Failed to write %s: %m", directoryLockFile); elog(LOG, "Failed to write %s: %m", directoryLockFile);
close(fd); close(fd);
return; return;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Group * Copyright 2000 by PostgreSQL Global Development Group
* *
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.10 2002/02/23 01:31:36 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.11 2002/03/02 21:39:33 momjian Exp $
*/ */
%{ %{
...@@ -137,7 +137,7 @@ ProcessConfigFile(GucContext context) ...@@ -137,7 +137,7 @@ ProcessConfigFile(GucContext context)
Assert(context == PGC_POSTMASTER || context == PGC_BACKEND Assert(context == PGC_POSTMASTER || context == PGC_BACKEND
|| context == PGC_SIGHUP); || context == PGC_SIGHUP);
Assert(DataDir); Assert(DataDir);
elevel = (context == PGC_SIGHUP) ? DEBUG : ERROR; elevel = (context == PGC_SIGHUP) ? DEBUG3 : ERROR;
/* /*
* Open file * Open file
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Support for grand unified configuration scheme, including SET * Support for grand unified configuration scheme, including SET
* command, configuration file, and command line options. * command, configuration file, and command line options.
* *
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.60 2002/03/01 22:45:16 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.61 2002/03/02 21:39:34 momjian Exp $
* *
* Copyright 2000 by PostgreSQL Global Development Group * Copyright 2000 by PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "utils/array.h" #include "utils/array.h"
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/datetime.h" #include "utils/datetime.h"
#include "utils/elog.h"
#include "pgstat.h" #include "pgstat.h"
...@@ -432,11 +433,6 @@ static struct config_int ...@@ -432,11 +433,6 @@ static struct config_int
1000, 25, INT_MAX, NULL, NULL 1000, 25, INT_MAX, NULL, NULL
}, },
{
"debug_level", PGC_USERSET, PGC_S_DEFAULT, &DebugLvl,
0, 0, 16, NULL, NULL
},
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
{ {
"trace_lock_oidmin", PGC_SUSET, PGC_S_DEFAULT, &Trace_lock_oidmin, "trace_lock_oidmin", PGC_SUSET, PGC_S_DEFAULT, &Trace_lock_oidmin,
...@@ -556,6 +552,12 @@ static struct config_real ...@@ -556,6 +552,12 @@ static struct config_real
static struct config_string static struct config_string
ConfigureNamesString[] = ConfigureNamesString[] =
{ {
{
"client_min_messages", PGC_USERSET, PGC_S_DEFAULT, &client_min_messages_str,
client_min_messages_str_default, check_client_min_messages,
assign_client_min_messages
},
{ {
"default_transaction_isolation", PGC_USERSET, PGC_S_DEFAULT, &default_iso_level_string, "default_transaction_isolation", PGC_USERSET, PGC_S_DEFAULT, &default_iso_level_string,
"read committed", check_defaultxactisolevel, assign_defaultxactisolevel "read committed", check_defaultxactisolevel, assign_defaultxactisolevel
...@@ -571,6 +573,12 @@ static struct config_string ...@@ -571,6 +573,12 @@ static struct config_string
PG_KRB_SRVTAB, NULL, NULL PG_KRB_SRVTAB, NULL, NULL
}, },
{
"server_min_messages", PGC_USERSET, PGC_S_DEFAULT, &server_min_messages_str,
server_min_messages_str_default, check_server_min_messages,
assign_server_min_messages
},
#ifdef ENABLE_SYSLOG #ifdef ENABLE_SYSLOG
{ {
"syslog_facility", PGC_POSTMASTER, PGC_S_DEFAULT, &Syslog_facility, "syslog_facility", PGC_POSTMASTER, PGC_S_DEFAULT, &Syslog_facility,
...@@ -886,7 +894,7 @@ set_config_option(const char *name, const char *value, ...@@ -886,7 +894,7 @@ set_config_option(const char *name, const char *value,
bool makeDefault; bool makeDefault;
if (context == PGC_SIGHUP) if (context == PGC_SIGHUP)
elevel = DEBUG; elevel = DEBUG1;
else if (guc_session_init) else if (guc_session_init)
elevel = NOTICE; elevel = NOTICE;
else else
...@@ -901,9 +909,8 @@ set_config_option(const char *name, const char *value, ...@@ -901,9 +909,8 @@ set_config_option(const char *name, const char *value,
if (record->source > source) if (record->source > source)
{ {
if (DebugLvl > 1) elog(DEBUG2, "setting %s refused because previous source is higher",
elog(DEBUG, "setting %s refused because previous source is higher", name);
name);
return false; return false;
} }
makeDefault = source < PGC_S_SESSION; makeDefault = source < PGC_S_SESSION;
......
...@@ -108,8 +108,15 @@ ...@@ -108,8 +108,15 @@
# #
# Debug display # Message display
# #
#server_min_messages = log # Values, in order of decreasing detail:
# debug5, debug4, debug3, debug2, debug1,
# info, notice, error, log, fatal, panic
#client_min_messages = info # Values, in order of decreasing detail:
# debug5, debug4, debug3, debug2, debug1,
# log, info, notice, error
#silent_mode = false #silent_mode = false
#log_connections = false #log_connections = false
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.144 2002/03/01 22:45:16 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.145 2002/03/02 21:39:34 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -452,7 +452,7 @@ PGSQL_OPT="-F -D$PGDATA" ...@@ -452,7 +452,7 @@ PGSQL_OPT="-F -D$PGDATA"
if [ "$debug" = yes ] if [ "$debug" = yes ]
then then
BACKEND_TALK_ARG="-d" BACKEND_TALK_ARG="-d 5"
else else
PGSQL_OPT="$PGSQL_OPT -o /dev/null" PGSQL_OPT="$PGSQL_OPT -o /dev/null"
fi fi
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Group * Copyright 2000 by PostgreSQL Global Development Group
* *
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.41 2001/11/05 17:46:31 momjian Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.42 2002/03/02 21:39:34 momjian Exp $
*/ */
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
...@@ -229,6 +229,8 @@ psql_completion(char *text, int start, int end) ...@@ -229,6 +229,8 @@ psql_completion(char *text, int start, int end)
"ksqo", "ksqo",
"geqo", "geqo",
"fsync", "fsync",
"server_min_messages",
"client_min_messages",
"debug_assertions", "debug_assertions",
"debug_print_query", "debug_print_query",
"debug_print_parse", "debug_print_parse",
...@@ -252,7 +254,6 @@ psql_completion(char *text, int start, int end) ...@@ -252,7 +254,6 @@ psql_completion(char *text, int start, int end)
"geqo_random_seed", "geqo_random_seed",
"sort_mem", "sort_mem",
"vacuum_mem", "vacuum_mem",
"debug_level",
"max_expr_depth", "max_expr_depth",
"commit_delay", "commit_delay",
"commit_siblings", "commit_siblings",
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: bootstrap.h,v 1.26 2001/11/05 17:46:31 momjian Exp $ * $Id: bootstrap.h,v 1.27 2002/03/02 21:39:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -34,8 +34,6 @@ typedef struct hashnode ...@@ -34,8 +34,6 @@ typedef struct hashnode
extern Relation reldesc; extern Relation reldesc;
extern Form_pg_attribute attrtypes[MAXATTR]; extern Form_pg_attribute attrtypes[MAXATTR];
extern int numattr; extern int numattr;
extern int DebugMode;
extern int BootstrapMain(int ac, char *av[]); extern int BootstrapMain(int ac, char *av[]);
extern void index_register(char *heap, char *ind, IndexInfo *indexInfo); extern void index_register(char *heap, char *ind, IndexInfo *indexInfo);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: miscadmin.h,v 1.99 2002/02/18 23:11:31 petere Exp $ * $Id: miscadmin.h,v 1.100 2002/03/02 21:39:34 momjian Exp $
* *
* NOTES * NOTES
* some of the information in this file should be moved to * some of the information in this file should be moved to
...@@ -129,8 +129,6 @@ extern DLLIMPORT Oid MyDatabaseId; ...@@ -129,8 +129,6 @@ extern DLLIMPORT Oid MyDatabaseId;
extern bool IsUnderPostmaster; extern bool IsUnderPostmaster;
extern int DebugLvl;
/* Date/Time Configuration /* Date/Time Configuration
* *
* Constants to pass info from runtime environment: * Constants to pass info from runtime environment:
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: elog.h,v 1.30 2001/11/05 17:46:36 momjian Exp $ * $Id: elog.h,v 1.31 2002/03/02 21:39:35 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -15,15 +15,25 @@ ...@@ -15,15 +15,25 @@
#define ELOG_H #define ELOG_H
/* Error level codes */ /* Error level codes */
#define NOTICE 0 /* random info, sent to frontend */ #define DEBUG5 10 /* sent only to server logs, label DEBUG */
#define ERROR (-1) /* user error - return to known state */ #define DEBUG4 11 /* logs in decreasing detail */
#define FATAL 1 /* fatal error - abort process */ #define DEBUG3 12
#define REALLYFATAL 2 /* take down the other backends with me */ #define DEBUG2 13
#define DEBUG (-2) /* debug message */ #define DEBUG1 14
#define LOG 15 /* sent only to server logs by default,
* label LOG. */
#define INFO 16 /* sent only to client by default, for
* informative messages that are part of
* normal query operation. */
#define NOTICE 17 /* sent to client and server by default,
* important messages, for unusual cases that
* should be reported but are not serious
* enough to abort the query. */
#define ERROR 18 /* user error - return to known state */
#define FATAL 19 /* fatal error - abort process */
#define PANIC 20 /* take down the other backends with me */
/* temporary nonsense... */ /*#define DEBUG DEBUG5*/ /* Backward compatibility with pre-7.3 */
#define STOP REALLYFATAL
#define LOG DEBUG
/* Configurable parameters */ /* Configurable parameters */
#ifdef ENABLE_SYSLOG #ifdef ENABLE_SYSLOG
...@@ -32,6 +42,10 @@ extern int Use_syslog; ...@@ -32,6 +42,10 @@ extern int Use_syslog;
extern bool Log_timestamp; extern bool Log_timestamp;
extern bool Log_pid; extern bool Log_pid;
extern char *server_min_messages_str;
extern char *client_min_messages_str;
extern const char server_min_messages_str_default[];
extern const char client_min_messages_str_default[];
extern void extern void
elog(int lev, const char *fmt,...) elog(int lev, const char *fmt,...)
...@@ -41,4 +55,9 @@ __attribute__((format(printf, 2, 3))); ...@@ -41,4 +55,9 @@ __attribute__((format(printf, 2, 3)));
extern int DebugFileOpen(void); extern int DebugFileOpen(void);
extern bool check_server_min_messages(const char *lev);
extern void assign_server_min_messages(const char *lev);
extern bool check_client_min_messages(const char *lev);
extern void assign_client_min_messages(const char *lev);
#endif /* ELOG_H */ #endif /* ELOG_H */
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
int int
elog_DEBUG(void) elog_DEBUG(void)
{ {
return DEBUG; return LOG;
} }
int int
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* procedural language * procedural language
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.29 2001/11/29 22:57:37 tgl Exp $ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.30 2002/03/02 21:39:35 momjian Exp $
* *
* This software is copyrighted by Jan Wieck - Hamburg. * This software is copyrighted by Jan Wieck - Hamburg.
* *
...@@ -1207,7 +1207,7 @@ raise_level : K_EXCEPTION ...@@ -1207,7 +1207,7 @@ raise_level : K_EXCEPTION
} }
| K_DEBUG | K_DEBUG
{ {
$$ = DEBUG; $$ = DEBUG5;
} }
; ;
......
This diff is collapsed.
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* ENHANCEMENTS, OR MODIFICATIONS. * ENHANCEMENTS, OR MODIFICATIONS.
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.49 2002/01/24 19:31:36 tgl Exp $ * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.50 2002/03/02 21:39:35 momjian Exp $
* *
**********************************************************************/ **********************************************************************/
...@@ -1268,7 +1268,7 @@ pltcl_elog(ClientData cdata, Tcl_Interp *interp, ...@@ -1268,7 +1268,7 @@ pltcl_elog(ClientData cdata, Tcl_Interp *interp,
else if (strcmp(argv[1], "FATAL") == 0) else if (strcmp(argv[1], "FATAL") == 0)
level = FATAL; level = FATAL;
else if (strcmp(argv[1], "DEBUG") == 0) else if (strcmp(argv[1], "DEBUG") == 0)
level = DEBUG; level = DEBUG1;
else else
{ {
Tcl_AppendResult(interp, "Unknown elog level '", argv[1], Tcl_AppendResult(interp, "Unknown elog level '", argv[1],
......
This diff is collapsed.
...@@ -136,8 +136,8 @@ INSERT INTO iportaltest (i, d, p) ...@@ -136,8 +136,8 @@ INSERT INTO iportaltest (i, d, p)
--- test creation of SERIAL column --- test creation of SERIAL column
--- ---
CREATE TABLE serialTest (f1 text, f2 serial); CREATE TABLE serialTest (f1 text, f2 serial);
NOTICE: CREATE TABLE will create implicit sequence 'serialtest_f2_seq' for SERIAL column 'serialtest.f2' INFO: CREATE TABLE will create implicit sequence 'serialtest_f2_seq' for SERIAL column 'serialtest.f2'
NOTICE: CREATE TABLE / UNIQUE will create implicit index 'serialtest_f2_key' for table 'serialtest' INFO: CREATE TABLE / UNIQUE will create implicit index 'serialtest_f2_key' for table 'serialtest'
INSERT INTO serialTest VALUES ('foo'); INSERT INTO serialTest VALUES ('foo');
INSERT INTO serialTest VALUES ('bar'); INSERT INTO serialTest VALUES ('bar');
INSERT INTO serialTest VALUES ('force', 100); INSERT INTO serialTest VALUES ('force', 100);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -5,8 +5,8 @@ CREATE TABLE a (aa TEXT); ...@@ -5,8 +5,8 @@ CREATE TABLE a (aa TEXT);
CREATE TABLE b (bb TEXT) INHERITS (a); CREATE TABLE b (bb TEXT) INHERITS (a);
CREATE TABLE c (cc TEXT) INHERITS (a); CREATE TABLE c (cc TEXT) INHERITS (a);
CREATE TABLE d (dd TEXT) INHERITS (b,c,a); CREATE TABLE d (dd TEXT) INHERITS (b,c,a);
NOTICE: CREATE TABLE: merging multiple inherited definitions of attribute "aa" INFO: CREATE TABLE: merging multiple inherited definitions of attribute "aa"
NOTICE: CREATE TABLE: merging multiple inherited definitions of attribute "aa" INFO: CREATE TABLE: merging multiple inherited definitions of attribute "aa"
INSERT INTO a(aa) VALUES('aaa'); INSERT INTO a(aa) VALUES('aaa');
INSERT INTO a(aa) VALUES('aaaa'); INSERT INTO a(aa) VALUES('aaaa');
INSERT INTO a(aa) VALUES('aaaaa'); INSERT INTO a(aa) VALUES('aaaaa');
......
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