How to silence psql notices, warnings, etc.?

Started by Kynn Jonesabout 18 years ago5 messagesgeneral
Jump to latest
#1Kynn Jones
kynnjo@gmail.com

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kynn Jones (#1)
Re: How to silence psql notices, warnings, etc.?

"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

#3Scott Marlowe
scott.marlowe@gmail.com
In reply to: Kynn Jones (#1)
Re: How to silence psql notices, warnings, etc.?

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.

#4Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Kynn Jones (#1)
Re: How to silence psql notices, warnings, etc.?

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

#5Kynn Jones
kynnjo@gmail.com
In reply to: Tom Lane (#2)
Re: How to silence psql notices, warnings, etc.?

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