Re: [BUGS] Bug #928: server_min_messages (log_min_messages - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [BUGS] Bug #928: server_min_messages (log_min_messages
Date
Msg-id 200305270439.h4R4dvl20878@candle.pha.pa.us
Whole thread Raw
In response to Re: [BUGS] Bug #928: server_min_messages (log_min_messages in CVS)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] Bug #928: server_min_messages (log_min_messages in CVS)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > The reason I changed the debug_ ones is that those go directly to the
> > server log file, not to the client.
>
> IIRC, all that stuff goes through elog (if there's anything left in the
> standard build that writes straight to stderr, we need to be fixing the
> code, not messing with GUC defaults).  So AFAIK the log_min_messages
> setting ought to control it all.  What are you seeing that I don't?

I tried this as a non-super user and saw the parser info in the logs.

Looking at the C code, the debug_* stuff goes to the logs as LOG.

I suppose you could set log_min_messages above LOG, but that seems too
dangerous.  I don't have a problem changing only the log_* settings, but
we shouldn't assume there is any way to protect the log file.  I think
we are restricting the log_* settings only so they can not be supressed
ffrom the logs.

---------------------------------------------------------------------------

test=> select current_user;
 current_user
--------------
 wilson
(1 row)

test=> set debug_print_parse to true;
SET
test=> select current_user;
 current_user
--------------
 wilson
(1 row)

test=> \q
(2) cat /u/pg/server.log
LOG:  database system was shut down at 2003-05-27 00:23:02 EDT
IN:  StartupXLOG (xlog.c:2510)
LOG:  checkpoint record is at 0/263D924
IN:  StartupXLOG (xlog.c:2538)
LOG:  redo record is at 0/263D924; undo record is at 0/0; shutdown TRUE
IN:  StartupXLOG (xlog.c:2558)
LOG:  next transaction id: 6216; next oid: 154373
IN:  StartupXLOG (xlog.c:2562)
LOG:  database system is ready
IN:  StartupXLOG (xlog.c:2819)
ERROR:  CREATE USER: user name "wilson" already exists
IN:  CreateUser (user.c:608)
ERROR:  parser: parse error at or near "current_user"
IN:  yyerror (scan.l:590)
LOG:  parse tree:
{QUERY :commandType 1 :querySource 0 :canSetTag true :utilityStmt <>
:resultRelation 0 :into <> :hasAggs false :hasSubLinks false :rtable <>
:jointree {FROMEXPR :fromlist <> :quals <>} :rowMarks () :targetList
({TARGETENTRY :resdom {RESDOM :resno 1 :restype 19 :restypmod -1 :resname
current_user :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false}
:expr {FUNCEXPR :funcid 745 :funcresulttype 19 :funcretset false :funcformat 0
:args <>}}) :groupClause <> :havingQual <> :distinctClause <> :sortClause <>
:limitOffset <> :limitCount <> :setOperations <> :resultRelations ()}

IN:  elog_node_display (print.c:85)
(
--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Sequence usage patch
Next
From: Gavin Sherry
Date:
Subject: Re: Sequence usage patch