How to suppress INFO messages when running psql sc

2020-02-07 04:10发布

I'm seeing INFO messages when I run my tests and I thought that I had gotten rid of them by setting the client_min_messages PGOPTION. Here's my command:


PGOPTIONS='--client-min-messages=warning' \
          psql  -h localhost \
                -p 5432 \
                -d my_db \
                -U my_user \
                --no-align \
                --field-separator '|' \
                --pset footer \
                --quiet \
                -v AUTOCOMMIT=off \
                -X \
                -v VERBOSITY=terse \
                -v ON_ERROR_STOP=1 \
                --pset pager=off \
                -f tests/test.sql \
                -o "$test_results"

Can someone advise me on how to turn off the INFO messages?

1条回答
男人必须洒脱
2楼-- · 2020-02-07 04:19

This works for me (PostgreSQL 9.1.4 on Debian GNU Linux):

env PGOPTIONS='-c client_min_messages=WARNING' psql ...

I do that according to the manual about Setting Parameters.

Note, however, that there is no message level INFO for client_min_messages.
That's only applicable to log_min_messages and log_min_error_statement.

查看更多
登录 后发表回答