加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – 是否有一个“pg_restore –quiet”选项,如“psql

发布时间:2020-12-13 16:37:41 所属栏目:百科 来源:网络整理
导读:psql有一个-q / –quiet选项(环境变量QUIET)。 pg_restore没有安静的选项。有没有办法使pg_restore没有详细地显示正在执行的SQL命令? # e.g.,here's the verbose output that I don't want to see:$ pg_restore --cluster 8.4/mycluster mycluster.dump----
psql有一个-q / –quiet选项(环境变量QUIET)。 pg_restore没有安静的选项。有没有办法使pg_restore没有详细地显示正在执行的SQL命令?
# 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 (
...
这个问题似乎意味着pg_restore正在执行这些SQL命令,你不希望在输出中看到它们。但输出它们只是应该做的。

pg_restore有两种操作模式,有或没有连接到数据库。当没有数据库(-d选项)调用时,如问题所示:

$ pg_restore –cluster 8.4/mycluster mycluster.dump

那么其唯一的目的是输出一组纯文本的SQL命令,这些SQL命令应该被提供给SQL解释器来还原数据库。那些SQL命令形成一个连贯的集合,没有任何冗长的概念,并且它们不被pg_restore本身执行。它们通常被重定向到一个文件以供稍后执行,或者通过管道进入psql以便立即执行。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读