Re: reindexdb command utlility

Lists: pgsql-bugs
From: Henrik Zagerholm <henke(at)mac(dot)se>
To: pgsql-bugs(at)postgresql(dot)org
Subject: reindexdb command utlility
Date: 2006-05-29 13:31:59
Message-ID: 4922783A-B8DC-4092-BEED-29C832A110AD@mac.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hello Postgres team,

I used wanted to point out the the ( -q, --quiet ) parameter for
reindexdb command utility does not work.
Also reindexdb writes NOTICE to standard err for every table it
reindexes which makes it really hard to use in script as it always
produces an "errror". :-)

If this is the way it should work I would be interested in an
explanation. =)

Thank you for a wonderful database!

Regards,
Henrik


From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Henrik Zagerholm <henke(at)mac(dot)se>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-05-31 01:47:49
Message-ID: 20060531014749.GA17578@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

> I used wanted to point out the the ( -q, --quiet ) parameter for
> reindexdb command utility does not work.
Actually it is *not* a bug. The NOTICE is printed by the REINDEX
command; reindexdb is just a wrapper around REINDEX command. If you
set up 'client_min_messages' in postgresql.conf, you don't get those
'annoying' messages.

> Also reindexdb writes NOTICE to standard err for every table it
> reindexes which makes it really hard to use in script as it always
> produces an "errror". :-)
>
You can always ignore NOTICE. grep is your friend. :-)

Looking at the code, IMHO we could raise the ereport from NOTICE to
INFO (see the patch attached). None of the scripts actually raise
NOTICEs if it succeeds.

Comments?

--
Euler Taveira de Oliveira
http://www.timbira.com/

Attachment Content-Type Size
a.diff text/plain 989 bytes

From: Henrik Zagerholm <henke(at)mac(dot)se>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-05-31 06:43:59
Message-ID: 67E2B1FE-F48E-4625-A4FC-67CD067FEB0D@mac.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


31 maj 2006 kl. 03:47 skrev Euler Taveira de Oliveira:

>> I used wanted to point out the the ( -q, --quiet ) parameter for
>> reindexdb command utility does not work.
> Actually it is *not* a bug. The NOTICE is printed by the REINDEX
> command; reindexdb is just a wrapper around REINDEX command. If you
> set up 'client_min_messages' in postgresql.conf, you don't get those
> 'annoying' messages.
I'll take a look at that. I have to make sure that I don't need it
somewhere else first. :-)
>
>> Also reindexdb writes NOTICE to standard err for every table it
>> reindexes which makes it really hard to use in script as it always
>> produces an "errror". :-)
>>
> You can always ignore NOTICE. grep is your friend. :-)
True, but usually I like to have my ERROR messages to stderr and INFO
to stdout.

> Looking at the code, IMHO we could raise the ereport from NOTICE to
> INFO (see the patch attached). None of the scripts actually raise
> NOTICEs if it succeeds.
>
> Comments?
INFO sounds like a good idea. What do you think about sending INFO to
stdout instead of stderr? (As it seems that ereport() automagically
sends the message to stderr)

Cheers,
Henrik
>
>
> --
> Euler Taveira de Oliveira
> http://www.timbira.com/
> <a.diff>


From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Henrik Zagerholm <henke(at)mac(dot)se>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-05-31 23:22:22
Message-ID: 20060531232222.GB1436@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Henrik Zagerholm wrote:

> >You can always ignore NOTICE. grep is your friend. :-)
> True, but usually I like to have my ERROR messages to stderr and INFO
> to stdout.
>
But it's not true in PostgreSQL. All ereport() messages are sent to
stderr. In some scripts, the -e (echo) is used to print command to
stdout. Like I said, you need to "| grep -v" your stderr output.

--
Euler Taveira de Oliveira
http://www.timbira.com/


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Henrik Zagerholm <henke(at)mac(dot)se>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-06-07 13:13:15
Message-ID: 200606071313.k57DDFQ00413@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


Patch applied. Thanks.

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

Euler Taveira de Oliveira wrote:
> > I used wanted to point out the the ( -q, --quiet ) parameter for
> > reindexdb command utility does not work.
> Actually it is *not* a bug. The NOTICE is printed by the REINDEX
> command; reindexdb is just a wrapper around REINDEX command. If you
> set up 'client_min_messages' in postgresql.conf, you don't get those
> 'annoying' messages.
>
> > Also reindexdb writes NOTICE to standard err for every table it
> > reindexes which makes it really hard to use in script as it always
> > produces an "errror". :-)
> >
> You can always ignore NOTICE. grep is your friend. :-)
>
> Looking at the code, IMHO we could raise the ereport from NOTICE to
> INFO (see the patch attached). None of the scripts actually raise
> NOTICEs if it succeeds.
>
> Comments?
>
>
> --
> Euler Taveira de Oliveira
> http://www.timbira.com/

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Henrik Zagerholm <henke(at)mac(dot)se>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-06-07 14:24:23
Message-ID: 29691.1149690263@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Patch applied. Thanks.

Why is this an improvement? AFAIR an INFO message is *not suppressible*
by adjusting client_min_messages, therefore this makes the system more
chatty not less so. It certainly doesn't do anything to address the
original complaint.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Henrik Zagerholm <henke(at)mac(dot)se>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-06-07 17:02:08
Message-ID: 200606071702.k57H28l06437@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Patch applied. Thanks.
>
> Why is this an improvement? AFAIR an INFO message is *not suppressible*
> by adjusting client_min_messages, therefore this makes the system more
> chatty not less so. It certainly doesn't do anything to address the
> original complaint.

I thought it needed changing for consistency. Shouldn't status messages
like this be INFO:

test=> REINDEX DATABASE test;
NOTICE: table "pg_class" was reindexed
NOTICE: table "sql_languages" was reindexed
NOTICE: table "sql_packages" was reindexed
NOTICE: table "sql_parts" was reindexed

If I do VACUUM VERBOSE, those messages are INFO.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Henrik Zagerholm <henke(at)mac(dot)se>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-06-07 17:17:01
Message-ID: 3677.1149700621@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> I thought it needed changing for consistency. Shouldn't status messages
> like this be INFO:
> test=> REINDEX DATABASE test;
> NOTICE: table "pg_class" was reindexed

> If I do VACUUM VERBOSE, those messages are INFO.

Yeah, *only because you said VERBOSE*. When we implemented the current
elog level scheme, we designed INFO as non-suppressible so that it would
mimic the previous behavior of VACUUM VERBOSE.

If REINDEX had a VERBOSE option, it would make sense to put out the
messages as INFO when VERBOSE was used. But it doesn't (and this is
not a request to add one). Without VERBOSE, I think it's utterly
unacceptable to force the messages out regardless of client_min_messages.
NOTICE was a reasonable level, maybe LOG would be a better one. But
not INFO.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Henrik Zagerholm <henke(at)mac(dot)se>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-06-07 17:20:27
Message-ID: 200606071720.k57HKRu09624@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I thought it needed changing for consistency. Shouldn't status messages
> > like this be INFO:
> > test=> REINDEX DATABASE test;
> > NOTICE: table "pg_class" was reindexed
>
> > If I do VACUUM VERBOSE, those messages are INFO.
>
> Yeah, *only because you said VERBOSE*. When we implemented the current
> elog level scheme, we designed INFO as non-suppressible so that it would
> mimic the previous behavior of VACUUM VERBOSE.
>
> If REINDEX had a VERBOSE option, it would make sense to put out the
> messages as INFO when VERBOSE was used. But it doesn't (and this is
> not a request to add one). Without VERBOSE, I think it's utterly
> unacceptable to force the messages out regardless of client_min_messages.
> NOTICE was a reasonable level, maybe LOG would be a better one. But
> not INFO.

OK, reverted.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Henrik Zagerholm <henke(at)mac(dot)se>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-06-08 00:55:17
Message-ID: 20060608005517.GB1429@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Tom Lane wrote:

> Yeah, *only because you said VERBOSE*. When we implemented the current
> elog level scheme, we designed INFO as non-suppressible so that it would
> mimic the previous behavior of VACUUM VERBOSE.
>
Agreed.

> If REINDEX had a VERBOSE option, it would make sense to put out the
> messages as INFO when VERBOSE was used. But it doesn't (and this is
> not a request to add one). Without VERBOSE, I think it's utterly
> unacceptable to force the messages out regardless of client_min_messages.
> NOTICE was a reasonable level, maybe LOG would be a better one. But
> not INFO.
>
LOG would be a good option, but maybe a small hack in reindexdb is
better.

--
Euler Taveira de Oliveira
http://www.timbira.com/

Attachment Content-Type Size
r.diff text/plain 719 bytes

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Henrik Zagerholm <henke(at)mac(dot)se>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-08-22 01:02:23
Message-ID: 200608220102.k7M12Os11560@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

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

Euler Taveira de Oliveira wrote:
> Tom Lane wrote:
>
> > Yeah, *only because you said VERBOSE*. When we implemented the current
> > elog level scheme, we designed INFO as non-suppressible so that it would
> > mimic the previous behavior of VACUUM VERBOSE.
> >
> Agreed.
>
> > If REINDEX had a VERBOSE option, it would make sense to put out the
> > messages as INFO when VERBOSE was used. But it doesn't (and this is
> > not a request to add one). Without VERBOSE, I think it's utterly
> > unacceptable to force the messages out regardless of client_min_messages.
> > NOTICE was a reasonable level, maybe LOG would be a better one. But
> > not INFO.
> >
> LOG would be a good option, but maybe a small hack in reindexdb is
> better.
>
>
> --
> Euler Taveira de Oliveira
> http://www.timbira.com/

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Henrik Zagerholm <henke(at)mac(dot)se>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: reindexdb command utlility
Date: 2006-09-02 02:43:12
Message-ID: 200609020243.k822hCV17508@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


Patch applied. Thanks.

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

Euler Taveira de Oliveira wrote:
> Tom Lane wrote:
>
> > Yeah, *only because you said VERBOSE*. When we implemented the current
> > elog level scheme, we designed INFO as non-suppressible so that it would
> > mimic the previous behavior of VACUUM VERBOSE.
> >
> Agreed.
>
> > If REINDEX had a VERBOSE option, it would make sense to put out the
> > messages as INFO when VERBOSE was used. But it doesn't (and this is
> > not a request to add one). Without VERBOSE, I think it's utterly
> > unacceptable to force the messages out regardless of client_min_messages.
> > NOTICE was a reasonable level, maybe LOG would be a better one. But
> > not INFO.
> >
> LOG would be a good option, but maybe a small hack in reindexdb is
> better.
>
>
> --
> Euler Taveira de Oliveira
> http://www.timbira.com/

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +