Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 298
shevy Avatar asked Feb 14 '14 11:02

shevy


1 Answers

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';
like image 196
Craig Ringer Avatar answered Oct 01 '22 01:10

Craig Ringer