Обсуждение: How to silence psql notices, warnings, etc.?

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

How to silence psql notices, warnings, etc.?

От
"Kynn Jones"
Дата:
Hi!

How does one silence NOTICE and WARNING messages in psql?  I've tried \set QUIET on, \set VERBOSITY terse, and even \o /dev/null, but I still get them!

TIA!

Kynn

Re: How to silence psql notices, warnings, etc.?

От
Tom Lane
Дата:
"Kynn Jones" <kynnjo@gmail.com> writes:
> How does one silence NOTICE and WARNING messages in psql?  I've tried \set
> QUIET on, \set VERBOSITY terse, and even \o /dev/null, but I still get them!

Set client_min_messages to, say, ERROR.  There's no psql-side control of
that.

            regards, tom lane

Re: How to silence psql notices, warnings, etc.?

От
"Scott Marlowe"
Дата:
On Fri, Mar 14, 2008 at 2:28 PM, Kynn Jones <kynnjo@gmail.com> wrote:
> Hi!
>
> How does one silence NOTICE and WARNING messages in psql?  I've tried \set
> QUIET on, \set VERBOSITY terse, and even \o /dev/null, but I still get them!

If you start postgresql from the pg_ctl command line and it's set to
log to stdout, then continue to use that terminal for psql afterwards,
you will continue to get the warnings and notices because they're
coming out of the postmaster to the terminal you're on.

It's happened to me in the past.

Re: How to silence psql notices, warnings, etc.?

От
"Albe Laurenz"
Дата:
Kynn Jones wrote:
> How does one silence NOTICE and WARNING messages in psql?
> I've tried \set QUIET on, \set VERBOSITY terse, and even \o /dev/null,
> but I still get them!

Have you tried

SET client_min_messages = ERROR;
?

Yours,
Laurenz Albe

Re: How to silence psql notices, warnings, etc.?

От
"Kynn Jones"
Дата:
Tom, Albe,

Thanks for the client_min_messages pointer; it did the trick.

On Sun, Mar 16, 2008 at 2:53 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
If you start postgresql from the pg_ctl command line and it's set to
log to stdout, then continue to use that terminal for psql afterwards,
you will continue to get the warnings and notices because they're
coming out of the postmaster to the terminal you're on.

I don't use pg_ctl much, but thanks for the heads-up.

Kynn