Обсуждение: client_min_messages in dumps?

Поиск
Список
Период
Сортировка

client_min_messages in dumps?

От
Christopher Kings-Lynne
Дата:
Would anyone else think that dumping:

SET client_min_messages TO warning;

In pg_dumps would be cool?

It would mean that while restoring a dump you can actually see the wood 
for the trees when trying to see ERRORs and WARNINGs the the massive 
spam of messages you get while restoring.

Chris



Re: client_min_messages in dumps?

От
Tom Lane
Дата:
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> Would anyone else think that dumping:
>   SET client_min_messages TO warning;
> In pg_dumps would be cool?

> It would mean that while restoring a dump you can actually see the wood 
> for the trees when trying to see ERRORs and WARNINGs the the massive 
> spam of messages you get while restoring.

Another answer is to get rid of some of our chattier NOTICEs, or at
least downgrade 'em to DEBUG1 or thereabouts.  Does anyone really still
think that
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo"
is conveying any useful information?  It's not like you couldn't find
out the name of the index from "\d foo".

I think this is a better answer than having pg_dump try to force the
message level, since that would get in the way of seeing the messages
when you needed to do so for debugging reasons.

(cc'ing to Bruce who has always been the most vocal defender of those
notices... now where did I put my flameproof longjohns?)
        regards, tom lane


Re: client_min_messages in dumps?

От
Dennis Bjorklund
Дата:
On Tue, 29 Jun 2004, Tom Lane wrote:

> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo"
> is conveying any useful information?

Maybe there should be another level called NOVICE :-)

-- 
/Dennis Björklund



Re: client_min_messages in dumps?

От
Tom Lane
Дата:
Dennis Bjorklund <db@zigo.dhs.org> writes:
> On Tue, 29 Jun 2004, Tom Lane wrote:
>> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo"
>> is conveying any useful information?

> Maybe there should be another level called NOVICE :-)

Not a bad idea --- could satisfy everybody?
        regards, tom lane


Re: client_min_messages in dumps?

От
Bruce Momjian
Дата:
Tom Lane wrote:
> Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> > Would anyone else think that dumping:
> >   SET client_min_messages TO warning;
> > In pg_dumps would be cool?
> 
> > It would mean that while restoring a dump you can actually see the wood 
> > for the trees when trying to see ERRORs and WARNINGs the the massive 
> > spam of messages you get while restoring.
> 
> Another answer is to get rid of some of our chattier NOTICEs, or at
> least downgrade 'em to DEBUG1 or thereabouts.  Does anyone really still
> think that
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo"
> is conveying any useful information?  It's not like you couldn't find
> out the name of the index from "\d foo".
> 
> I think this is a better answer than having pg_dump try to force the
> message level, since that would get in the way of seeing the messages
> when you needed to do so for debugging reasons.
> 
> (cc'ing to Bruce who has always been the most vocal defender of those
> notices... now where did I put my flameproof longjohns?)

I agree changing some of those noiser notices would be good.  I think
the best idea would be to add a client_min_messages level of novice for
them.  In fact, looking at the code, I see that the INFO level is almost
never used in our code.  Perhaps we should just downgrade them to
INFO-level messages.

FYI, I have never advocated those messages.  Rather, I advocated
allowing users to control how much detail they see in their client and
in their logs.

--  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,
Pennsylvania19073
 


Re: client_min_messages in dumps?

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I agree changing some of those noiser notices would be good.  I think
> the best idea would be to add a client_min_messages level of novice for
> them.

Yes ...

> In fact, looking at the code, I see that the INFO level is almost
> never used in our code.  Perhaps we should just downgrade them to
> INFO-level messages.

No!  That is not a downgrade --- INFO messages are *not suppressable*.
        regards, tom lane


Re: client_min_messages in dumps?

От
Bruce Momjian
Дата:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I agree changing some of those noiser notices would be good.  I think
> > the best idea would be to add a client_min_messages level of novice for
> > them.
> 
> Yes ...
> 
> > In fact, looking at the code, I see that the INFO level is almost
> > never used in our code.  Perhaps we should just downgrade them to
> > INFO-level messages.
> 
> No!  That is not a downgrade --- INFO messages are *not suppressable*.

Uh, postgresql.conf has:#client_min_messages = notice   # Values, in order of decreasing detail:
       #   debug5, debug4, debug3, debug2, debug1,                                #   log, info, notice, warning,
error#log_min_messages= notice      # Values, in order of decreasing detail:                                #   debug5,
debug4,debug3, debug2, debug1,                                #   info, notice, warning, error, log, fatal,
                  #   panic
 

I also don't see LOG used much in the code at all.  It seems to be used
mostly by VACUUM and ANALYZE.  Seems something is wrong.


--  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,
Pennsylvania19073
 


Re: client_min_messages in dumps?

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I also don't see LOG used much in the code at all.  It seems to be used
> mostly by VACUUM and ANALYZE.  Seems something is wrong.

There is nothing wrong except that you've forgotten how we designed
VACUUM VERBOSE to work with the new logging-levels stuff... that is
basically what INFO is for.
        regards, tom lane


Re: client_min_messages in dumps?

От
Bruce Momjian
Дата:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I also don't see LOG used much in the code at all.  It seems to be used
> > mostly by VACUUM and ANALYZE.  Seems something is wrong.
> 
> There is nothing wrong except that you've forgotten how we designed
> VACUUM VERBOSE to work with the new logging-levels stuff... that is
> basically what INFO is for.

Well, then the postgresql.conf description is wrong, and
client_min_messages shouldn't be able to be set to 'info'.

--  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,
Pennsylvania19073
 


Re: client_min_messages in dumps?

От
Bruce Momjian
Дата:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I also don't see LOG used much in the code at all.  It seems to be used
> > mostly by VACUUM and ANALYZE.  Seems something is wrong.
> 
> There is nothing wrong except that you've forgotten how we designed
> VACUUM VERBOSE to work with the new logging-levels stuff... that is
> basically what INFO is for.
> 

OK, it turns out only postgresql.conf was wrong about mentioning INFO as
a proper client_min_messages level.  The SGML docs didn't mention it as
a value.

Added to TODO:
* Add NOVICE output level for helpful messages like automatic  sequence/index creation

--  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,
Pennsylvania19073