How to disable setval output when importing psql dump

I have already tried both:

SET client_min_messages TO WARNING; 

And the -q option at startup:

 psql -q -U postgres -d myDB -f /Users/hoaphan/dev/postgres_dump -p 5432 

However, its output (such pages):

  setval -------- 1 (1 row) setval -------- 1 (1 row) setval -------- 1 (1 row) setval -------- 1 (1 row) setval -------- 1 (1 row) setval -------- 1 (1 row) setval -------- 1 (1 row) setval -------- 1 (1 row) setval -------- 1 (1 row) setval -------- 1 (1 row) ... 
+6
source share
2 answers

The "silent" option -q is defined as: "run silently (no messages, only query output )".

The result of setval() is the result of the request, not the message, so a quiet option does not suppress this.

If you do not want to see the results of the query, you can redirect your output to /dev/null using the -o switch:

  psql -o / dev / null -q -U postgres -d myDB -f / Users / hoaphan / dev / postgres_dump -p 5432 

(I can't test it on Linux right now, but the equivalent thing works on Windows)

+7
source

I don’t think you can turn it off without modifying the dump file or pass it to the user filtering command, as that would mean turning off the query output, but if you don't need any of this, just use the -o switch to redirect it to the one you want file or / dev / null.

0
source

All Articles