运行psql脚本时如何隐藏INFO消息 [英] How to suppress INFO messages when running psql scripts
本文介绍了运行psql脚本时如何隐藏INFO消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在运行测试时看到INFO消息,并且认为我已经通过设置client_min_messages PGOPTION摆脱了它们.这是我的命令:
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"
有人可以建议我如何关闭INFO消息吗?
Can someone advise me on how to turn off the INFO messages?
推荐答案
这对我有用(在Debian GNU Linux上为PostgreSQL 9.1.4):
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
.
这篇关于运行psql脚本时如何隐藏INFO消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文