问题
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
--quietSpecifies 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
QUIETvariable 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