13

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.

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
shevy
  • 920
  • 1
  • 12
  • 18

1 Answers1

23

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';
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
  • 1
    In addition to that you may want to dial down the log level, which controls output of NOTICEs etc. See http://stackoverflow.com/questions/3530767/disable-notices-in-psql-output – harmic Feb 14 '14 at 11:29
  • cool I think that answered my question, now I only have to find out how to mark this as checked ... hmmm – shevy Feb 14 '14 at 11:36
  • the client variable did the trick – danius Nov 08 '17 at 21:45