Postgresql - is there a way to disable the display of INSERT statements when reading in from a file? [closed]

主宰稳场 提交于 2019-12-01 17:57:39

问题


I populate a postgresql database from a file.

I get a lot of:

INSERT 0 1

statements.

Is there a way to not display these commands at all? They scroll away earlier output on my shell right now and do not yield a lot of useful information (what does INSERT 0 1 mean? is that like saying "yo dude the insert command was a success"?).

It seems I get one INSERT 0 1 line for every INSERT statement in that .sql file I read from and this is a massive file.


回答1:


The psql manual says:

-q

--quiet

Specifies that psql should do its work quietly. By default, it prints welcome messages and various informational output. If this option is used, none of this happens. This is useful with the -c option. Within psql you can also set the QUIET variable to achieve the same effect.

Per @harmic's suggestion you may also want to set client_min_messages:

SET client_min_messages = 'ERROR';


来源:https://stackoverflow.com/questions/21777564/postgresql-is-there-a-way-to-disable-the-display-of-insert-statements-when-rea

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!