psql
有一個-q
/--quiet
選項(環境變量QUIET
)。 pg_restore
沒有安靜的選項。有什麼辦法可以使pg_restore
不會詳細地顯示它正在執行的SQL命令嗎?是否有像「psql --quiet」這樣的「pg_restore --quiet」選項?
# e.g., here's the verbose output that I don't want to see:
$ pg_restore --cluster 8.4/mycluster mycluster.dump
---- PostgreSQL database dump
--
SET statement_timeout = 0;SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;SET check_function_bodies = false;
...
--
-- Name: data_src; Type: TABLE; Schema: public; Owner: postgres; Tablespace:--
CREATE TABLE data_src (
...
爲什麼不簡單地將輸出重定向到'/ dev/nul'? – 2012-07-14 16:41:40
我不想將輸出重定向到/ dev/null,因爲我不想丟失任何潛在的錯誤消息。他們可能會去stderr,所以我可以將stdout重定向到/ dev/null,但我喜歡像 - quiet更好的想法。我不介意看到一些信息輸出,但不是每一個sql命令。 – 2012-07-14 20:16:51