在psql输出中禁用NOTICES [英] disable NOTICES in psql output
本文介绍了在psql输出中禁用NOTICES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何停止psql(PostgreSQL客户端)输出通知?例如
How do I stop psql (PostgreSQL client) from outputting notices? e.g.
psql:schema / auth.sql:20:注意:CREATE TABLE / PRIMARY KEY将为表用户
psql:schema/auth.sql:20: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "users_pkey" for table "users"
在我看来,程序应该是沉默的,除非它有错误或其他原因输出的东西。 >
In my opinion a program should be silent unless it has an error, or some other reason to output stuff.
推荐答案
SET client_min_messages TO WARNING;
那只能为会话设置,或者通过 ALTER ROLE
或 ALTER DATABASE
。
That could be set only for the session or made persistent with ALTER ROLE
or ALTER DATABASE
.
或者你可以把它放在你的。psqlrc。
Or you could put that in your ".psqlrc".
这篇关于在psql输出中禁用NOTICES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文