How to suppress NOTICE messages

Started by O.B.about 19 years ago2 messagesgeneral
Jump to latest
#1O.B.
funkjunk@bellsouth.net

How does one suppress NOTICE messages from appearing in stderr? I
have the following command and it appears that setting
client_min_messages to WARNING does not work.

psql -U postgres -d mytestdb -f mytest.sql -v
client_min_messages=WARNING -W

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: O.B. (#1)
Re: How to suppress NOTICE messages

"O.B." <funkjunk@bellsouth.net> writes:

How does one suppress NOTICE messages from appearing in stderr? I
have the following command and it appears that setting
client_min_messages to WARNING does not work.

psql -U postgres -d mytestdb -f mytest.sql -v
client_min_messages=WARNING -W

You seem to be confusing psql variables (\set) with server configuration
parameters (SET) ... there is no connection there at all.

What you need is a SQL command "SET client_min_messages=WARNING;".
If you don't want to put it in your scripts, consider a ~/.psqlrc
file, or use ALTER USER or ALTER DATABASE to make it default at
those granularities, or change the installation's default in
postgresql.conf. See
http://www.postgresql.org/docs/8.2/static/config-setting.html
for more ways to control configuration parameters.

regards, tom lane